I was trying to loop through my database for some results and recieved this error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /hermes/waloraweb032/b867/moo.classiadsinfo/ajax/searchApp.php on line 8
and heres my code:
<?php
require_once '../connect.php';
if(isset($_POST['search_term'])==true && empty($_POST['search_term'])==false)
{
$search_term=mysql_real_escape_string($_POST['search_term']);
$query=mysql_query("SELECT `Category`, `Type` FROM `autosuggest` WHERE `Category=.'$_POST[category]'` && `Type` LIKE '$search_term%'");
while(($row=mysql_fetch_assoc($query))!==false)
{
echo '<li><b>',$row['Type'],'</b></li>';
}
}
?>
please help!!!