Error: mysql_num_rows() expects parameter 1 to be resource

I was trying to pull some values from Database using PHP. My DB is MySQL. Suddenly I found the error:

mysql_num_rows() expects parameter 1 to be resource, boolean given in

I was trying to find out the problem. I went through the forum post in Daniweb after googling

Finally I fixed it. What was TROLLING is just a [ ‘ ‘ ] sign

My query which was giving error:

$query = "select * from service_order where account_manager_id = $var AND primary_connection_media= $var2";

When I fixed the error by putting ” around the variables, the query is:

$query = "select * from service_order where account_manager_id = '$var' AND primary_connection_media= '$var2'";

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s