I'm selecting data from mysql database and print it in a webpage. I'm using wamp server. why I can't fetch the data ?
$result = mysql_query("SELECT userid FROM user WHERE logid = 'root'") or die(mysql_error());
echo $result; //result view as Resource id #7
but I count number of rows which equels to root it views as 1
$result = mysql_query("SELECT userid FROM user WHERE logid = 'root'") or die(mysql_error());
$no_of_rows = mysql_num_rows($result);
echo $no_of_rows; //result view as 1