I've done several simple scripts for my site. When I'm trying to add these lines of code to one of the scripts, php produces the warning like:
Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in C:\Program Files\Apache Group\Apache2\htdocs\sducc\mainfile.php on line 71
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\Apache Group\Apache2\htdocs\sducc\mainfile.php on line 74
<!-- Clipboard start ["problem part"] -->
$request = mysql_query("select gens, action from module_actions where moduleid=1");
$numrows = mysql_numrows($request);
for($i=0; $i<$numrows; $i++) {
$action = mysql_fetch_array($request);
$module_actions[$i] =$action;
}
<!-- Clipboard end -->
Before these fragment I use contructions like and they work fine:
<!-- Clipboard start -->
$query = "select path, action, layout, weight, id from modules ".
"where active=1 order by layout and weight";
$request = mysql_query($query);
$numrows = mysql_numrows($request);
<!-- Clipboard end -->