narjis Posted February 28, 2012 Share Posted February 28, 2012 i'm running a simple query of LIKE SELECT statment but it says boolean resource given to mysql_fetch_assoc parameter 1 Here is my code $sql = "SELECT `city` FROM `cities` WHERE `city` LIKE '$search_term%'"; $result = mysql_query($sql); //echo ($sql); //if while($row=mysql_fetch_assoc($result)){ echo ("<li>".$row['cities']."</li>"); } please check my $sql statement is it wrong? Where? Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted February 28, 2012 Share Posted February 28, 2012 If you're getting that error message, apparently something is wrong with the query. I'll bet mysql_error would have produce some useful information to help solve this, so echo it and echo your query string to make sure it contains the values you'd expect it to contain. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.