0

Hi,
mysql_query() expects parameter 1 to be string, object given in C:\xampp\htdocs\livesearch\livesearch\ajax-search.php on line 18
need help

<?php


include_once ('database_connection.php');

if(isset($_GET['keyword'])){
    $keyword = 	trim($_GET['keyword']) ;
$keyword = mysqli_real_escape_string($dbc, $keyword);



$query = "SELECT * FROM register WHERE subject LIKE '%$keyword%'";
echo "SELECT * FROM register WHERE subject LIKE '%$keyword%' ";



//echo $query;
$result = mysql_query($dbc,$query);
if($result){
    if(mysql_affected_rows($dbc)!=0){
          while($row = mysql_fetch_array($result,MYSQLI_ASSOC)){
     echo '<p> <b>'.$row['subject'].'</b> '.$row['desc'].'</p>'   ;
     echo $row['subject'];
    }
    }else {
        echo 'No Results for :"'.$_GET['keyword'].'"';
    }
  
}
}else {
    echo 'Parameter Missing';
}




?>

mysql_query() expects parameter 1 to be string, object given in C:\xampp\htdocs\livesearch\livesearch\ajax-search.php on line 18

2
Contributors
1
Reply
4
Views
6 Years
Discussion Span
Last Post by tomato.pgn
0

ya there is error in line 18...just change it into following....
n if some other error persist let me know....

$result = mysql_query($query,$dbc);
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.