PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
This message is telling you that mysql_num_rows() must have a pointer to a valid result set, but it is being given a boolean value (true or false). This is caused by your query not producing a valid result set, several lines above. The proper way to detect query errors like this during the testing and debugging phase is to temporarily amend your query execution line like this:
$run = mysql_query($constructx) or die(mysql_error());
Now if your query fails, the MySQL error message will be sent to the browser and the script will terminate. Then you will see what the problem is. Once everything is working correctly, you should remove the "or die(...)" part, so that it won't accidentally be triggered once you launch your script publicly.
I assume line 52 is the line califdon posted? It shouldn't give that error... please paste the exact code you're using as it is now (with the change provided by califdon).
There must be more to your script. Where does $construct come from? You are using the same variable as a WHERE clause criterion and as the name of the SQL statement. That makes no sense. That last error probably comes from an invalid line that begins with "or". That must be a typo. I'm afraid none of your script makes any sense to me.
<?php
$foundnum = mysql_num_rows($run);
or die(mysql_error())
// should be
$foundnum = mysql_num_rows($run) or die(mysql_error());
?>
Your SELECT query also looks wrong, SELECT * FROM searchengine WHERE $construct doesn't make sense. (Unless $construct contains a string like 'id = 5')
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
You need to use mysql_select_db() to select whatever database you're using. Probably right after mysql_connect(). You see, a MySQL server is partitioned into separate databases, each holding it's own tables. You must tell your MySQL connection which database you want to communicate with.