Forum Moderators: coopster

Message Too Old, No Replies

database problem

         

contraband

11:04 am on Jul 3, 2006 (gmt 0)

10+ Year Member



hi,

i am trying to check if a row in my mysql database exists. i was looking through the php manual and i came accross the mysql_num_rows command, but im not really sure how to use it :(

i just want to check if a row exists and if it does, execute some code.

can anyone help?

thanks

Romeo

11:41 am on Jul 3, 2006 (gmt 0)

10+ Year Member



Just use it as mentioned in "Example 1" in the manual [php.net...]

If it comes back > 0 then run your other code, else do not.

Kind regards,
R.

Sekka

3:54 pm on Jul 3, 2006 (gmt 0)

10+ Year Member



Note, mysql_num_rows () returns an error if no rows exist at all in the table.

Or, it use to a long time ago and I've just coded for that since.