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!
Moderator: General Moderators
psychotomus
Forum Contributor
Posts: 487 Joined: Fri Jul 11, 2003 1:59 am
Post
by psychotomus » Fri Apr 14, 2006 1:24 pm
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) {
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Apr 14, 2006 1:44 pm
mysql_error() may hold some information you may find useful.
ntbd
Forum Newbie
Posts: 21 Joined: Wed Apr 12, 2006 6:42 am
Post
by ntbd » Fri Apr 14, 2006 1:51 pm
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.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Apr 14, 2006 1:58 pm
It is not recommended to ever use the @ operator. Hiding errors does not change the fact that they still fire.
itsmani1
Forum Regular
Posts: 791 Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:
Post
by itsmani1 » Sat Apr 15, 2006 2:44 am
what does this @ sign do?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sat Apr 15, 2006 9:11 am
itsmani1 wrote: what does this @ sign do?
error display suppression. Note the error still fires, but the output of the firing may get hidden.