note 34645 rejected from function.mysql-connect by pollita
| From: | pollita@php.net | Date: | Sat, 02 Aug 2003 04:03:44 +0000 |
| Subject: | note 34645 rejected from function.mysql-connect by pollita | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-53184@lists.php.net to get a copy of this message | ||
Note Submitter: tomjk@163.com
----
rs = mysql_query("SELECT id FROM users WHERE name = 'pete'");
if($row = mysql_fetch_array($rs))
{
mysql_query("UPDATE users SET visits=visits+1 WHERE id =
'".$row["id"]."'");
}
else
{
mysql_query("INSERT INTO users (name) VALUES ('pete')");
}