require 'connect_db.php';
require 'User.php';
$stmnt = $con->prepare("select f_name, l_name from user where f_name LIKE :q OR l_name LIKE :q OR dept LIKE :q OR batch LIKE :q OR email LIKE :q");
$q = $_GET['q'];
$q1 = "'%".$q."%'";
$stmnt->bindParam(':q',$q1);
$stmnt->execute();
$results = $stmnt->fetchAll(PDO::FETCH_OBJ);
echo count($results);
When I am writing it mysql command line it is returning 1 row but this code is not.. please help me to correct it.
My sql query is :select f_name, l_name from user where f_name LIKE '%s%' or l_name LIKE '%s';
this is returning 1 row.