MySQL & PHP Parameter 1 as Resource

Posted by Nik on Stack Overflow See other posts from Stack Overflow or by Nik
Published on 2010-05-30T12:35:33Z Indexed on 2010/05/30 12:42 UTC
Read the original article Hit count: 409

Filed under:
|
|
|
|

Alright, PHP is throwing this error at me (in the log) when I run the code mentioned below:

Error

mysql_num_rows() expects parameter 1 to be resource, string given in (place) on line 10

Line 9-11

$queryFP = ("SELECT * FROM db");
$countFP = mysql_num_rows($queryFP);
$aID = rand(1, $countFP);

I think it has something to do with the $queryFP's syntax, but I'm not completely sure how to fix it since $queryFP's syntax is the simplest query I've ever seen.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql