0

Hello'
I'm using following code and getting mysqlerror

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs/.....

Code is

$query="SELECT ('$retfield') FROM ('$table') WHERE ('$givefield')=('$val')";
$res=mysql_query($query);
if(mysql_num_rows($res) > 0){
    }

Upto my knowledge I'm using correct syntax bt I dnt where I'm going wrong.
Can anyone help me?

Edited by mike_2000_17: Fixed formatting

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by s_kanika
0

This will suffice:

$query="SELECT $retfield FROM $table WHERE $givefield='$val'";

It works Thanx a lot

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.