Page 1 of 1
mysql_num_rows
Posted: Fri Apr 14, 2006 1:24 pm
by psychotomus
Error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/interng8/public_html/credit-card-advice/partner/directory.php on line 241
Code: Select all
$pol = mysql_query("select * from lma_categories where parent = '".$tcat->id."' order by name limit $subcatsmainnum");
if (mysql_num_rows($pol) > 0) {
Posted: Fri Apr 14, 2006 1:44 pm
by feyd
mysql_error() may hold some information you may find useful.
Posted: Fri Apr 14, 2006 1:51 pm
by ntbd
If you know what the problem is just use '@' in front to run the function silently.
$n = @mysql_num_rows($query); will return a number if there is one and will report no errors if theres a problem.
Posted: Fri Apr 14, 2006 1:58 pm
by feyd
It is not recommended to ever use the @ operator. Hiding errors does not change the fact that they still fire.
Posted: Sat Apr 15, 2006 2:44 am
by itsmani1
what does this @ sign do?
Posted: Sat Apr 15, 2006 9:11 am
by feyd
itsmani1 wrote:what does this @ sign do?
error display suppression. Note the error still fires, but the output of the firing may get hidden.