Im getting the following error in a script..
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /Library/WebServer/Documents/QuarkWTP/HyperPublishing/hps_database_utility.php on line 182
Problem caused by osCommerce.
NOTE: (This problem manifested when I enabled "Use Search-Engine Safe URLs" and then goes away when I disable the "Use Search-Engine Safe URLs" feature in osCommerce. Unfortunately I need this feature to be activated because it facilitates the STS_Templates to work properly.)
Since the error message tells me what the problem is, I know where to start dealing with it but unfortunately I'm at a loss on how to fix it.
Below are the lines of code containing the referenced error
(line 182: $num_template_content = mysql_num_rows($result_template); )
------Code and surrounding lines-----------------
// Desc: retrieve template content for a publication
// Params: $template_id, $db
// Result: return $num_template_content
function get_template_content_count($template_id, $db){
$select_query = "SELECT * from hps_template_content WHERE template_id = " . $template_id;
$result_template = mysql_query($select_query, $db);
$num_template_content = mysql_num_rows($result_template);
//$template_content = mysql_fetch_assoc($result_template);
return $num_template_content;
-------------------------------------------------
The best I can tell is that it is a SELECT query that is stopping the script.... I am very new to PHP - can anyone explain this to me or point me in the right direction? I could really use a little guidance.