MySQL Forums
Forum List  »  PHP

mysql_num_rows() expects parameter 1 to be resource, boolean
Posted by: Taha Kirmani
Date: October 22, 2012 05:22AM

Hi,

I am writing this simple mysql code in my php program, but when i run it gives me an error message.

$query= "SELECT 'username' FROM 'users' WHERE 'username' LIKE '%search%'";
$query_run=mysql_query($query) or die('cannot execute '. mysql_error());


cannot execute You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''userasds' WHERE 'username' LIKE '%search%'' at line 1 "


Kindly tell me what is wrong in this code.
Thanks,
Taha



Edited 2 time(s). Last edit at 10/22/2012 05:24AM by Taha Kirmani.

Options: ReplyQuote


Subject
Written By
Posted
mysql_num_rows() expects parameter 1 to be resource, boolean
October 22, 2012 05:22AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.