Re: Re: [NEWMAN] make an "if" or "else if" statement from mysql.
| From: | Julio Nobrega Trabalhando | Date: | Tue, 19 Mar 2002 21:00:53 +0000 |
| Subject: | Re: Re: [NEWMAN] make an "if" or "else if" statement from mysql. | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-89212@lists.php.net to get a copy of this message | ||
> if (db_num_rows() > 0) { <= WHERE DOSE THIS VERABLE COME FROM?
This is just a count of the returned rows you have to make.
First, do something like this:
SELECT ip FROM table WHERE ip = visitor_ip;
If it returns 0 rows, it means you don't have the ip and need to store,
otherwise just update the view.
db_num_rows was a generic way to call the function you will use. Since
it's mysql, you can use mysql_num_rows.
So:
if (mysql_num_rows(mysql_query('the SELECT above')) {
//////
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca