• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Live search query using JS and PHP for QA forum

phpmysql


PHP Snippet 1:

foreach ($words as $keywords) { 
  echo $keywords.'<br>';
  $keyword = trim($keywords);
  if(strlen($keyword)>0){
    $sql="SELECT * FROM qa_posts WHERE title like '%".$keywords."%' OR content like '%".$keywords."%' OR tags like
    '%".$keywords."%' limit 10 "; 

  $q=mysqli_query($dbc,$sql);
  while($res=mysqli_fetch_array($q)){
   echo "<a href='".$res['slug']."'>".$res['title']."</a><br>";
  } 
 }
}

Related Snippets

PHP Sorting - getting 10, 11, 12 ... 1, 20, 2 rather than 1, 10, 11, 12 ... 2, 20

javascript html popup window

Remove "estimated for {country}" text after tax amount in Woocommerce checkout page

XSS attack still works despite htmlspecialchars() doing its work

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255

How to make dot match newline characters using regular expressions

I want a way to give path to my files which are outside of public folder in laravel

Currently Using CodeIgniter Framework i have an Error

Clear javascript source cache laravel 5.8

Why "Class 'GuzzleHttpClient' not found" even after Installing it in Laravel?

Is it possible to re-use an array taken from PHP via JSON in a $.ajax function?

Exact alternate to mcrypt_encrypt in PHP 7.2

Add rows to Single product Additional information table in WooCommerce 3.6

Input and output values for php into the browser?

About Contact Privacy policy Terms and conditions