code not working, PHP says it is!!!

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

User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

try and and see, i just did and it worked

anyway, thats is the reason you are getting what you are getting.

Mark
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

Thanks Bech anyway

im sure your right (you always are) :lol:

still cant believe i missed out

Code: Select all

$result = mysql_query($query)
i really should start sleeping normal hours instead of rushing to get projects finished for clients faster

and im gonna have to try ouy mysql_affected_rows() because i know for a fact in the manual it says it cant be used on SELECT statments
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

It appears that php's "mysql_affected_rows" calls mysql's "mysql_affected_rows"... which says:

"For SELECT statements, mysql_affected_rows() works like mysql_num_rows().
mysql_affected_rows() is currently implemented as a macro."
Mark
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

lol, i know you didnt get that from the manual :lol:
from manual wrote: mysql_affected_rows() does not work with SELECT statements; only on statements which modify records. To retrieve the number of rows returned by a SELECT, use mysql_num_rows().
i have tried this before as well and it has never worked for me :?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

read the user comments, you will find it there.

Mark
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

well, isnt that lame..............
Post Reply