• 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

ConstraintViolationListInterface to Exception in Symfony

Get keys from associative array [duplicate]

Inserting Country Selection into MySQL PHP [duplicate]

Select option from dropdown menu with PHP and mySql

Group rows by column and sum another column within groups [duplicate]

OctoberCMS / Anonymous Global Scope

Parameter is not sent to Laravel route in Ajax

PHP: Telegram Bot: Insert line break to text message

LARAVEL: How to fetch id dynamically in a query builder?

Smarty: undefined extension class 'Smarty_Internal_Method_Get_Template_Vars'

Dropdown with current value from Mysql

Laravel whole batch is cancelled if one Job fails

javascript html popup window

Select option menu read from database and use it's values

Sync Records With Default Values in Pivot Tables, Call to undefined method syncWithPivotDefaults()

About Contact Privacy policy Terms and conditions