Jump to content

please check


narjis

Recommended Posts

 

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?

Link to comment
https://forums.phpfreaks.com/topic/257905-please-check/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/257905-please-check/#findComment-1321940
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.