Jump to content


Photo

MySQL Error


  • Please log in to reply
3 replies to this topic

#1 DaveTomneyUK

DaveTomneyUK
  • Members
  • PipPip
  • Member
  • 13 posts
  • LocationUK, England

Posted 03 July 2006 - 07:43 PM

Hi,

Does anyone know why I am getting this error on the bottom of my site the only way I can get shut of it is by adding a @ at the start of the include function.

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/linux/user/htdocs/.inc/func/database.inc on line 75


#2 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 03 July 2006 - 07:47 PM

Because the query link that mysql_num_rows is using is "not a valid MySQL result resource in /home/linux/user/htdocs/.inc/func/database.inc on line 75". You should have more error reporting in place.
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#3 DaveTomneyUK

DaveTomneyUK
  • Members
  • PipPip
  • Member
  • 13 posts
  • LocationUK, England

Posted 03 July 2006 - 08:01 PM

this is line 75 of the function I cannot see nothing wrong.

UPDATE - Sorted

#4 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 03 July 2006 - 08:17 PM

When working with a database, the or die syntax is preferred, and should be used at (1) connection, (2) selection, and (3) query. Your MySQL resource is not valid, which means one of these steps failed.
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users