|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
mysql_numrows():
hi all,
i am a bit new to mySQL so this may well be a simple thing to fix, but i can't see it. i have a piece of code for accessing a database, which contains these lines: PHP Code:
however, when i try and run the code, i get this error: Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /home2/freakish/public_html/mysql/update.php on line 10 any suggestions as to why it is doing this would be appreciated as i don't have a clue as to why...? i've searched google with no help, it just keeps finding other peoples errors, lol. thanks in advance, |
|
#2
|
||||
|
||||
|
I posted this in a different thread, but try this as a debugging technique:
$result = @mysql_query($query) or die("Error ".mysql_errno().": ".mysql_error()."\nQuery: $query"); Generally when an argument, that's supposed to be results, isn't supplied, its because teh query wasn't executed properly... If the query fails, it' will explain why, and display the query... |
|
#3
|
|||
|
|||
|
thanks for the reply.
i had just tried this as i noticed someone had replied, and it informed me that it couldn't connect to the database - turns out the database connect line was missing.. oh dear, i truly am inexperienced ![]() but it works now, at least! |
|
#4
|
|||
|
|||
|
Nice code
Thanks for this tip!
jr ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > mysql_numrows(): |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|