re: the database locking
| From: | Matt Babineau | Date: | Fri, 26 Apr 2002 03:36:00 +0000 |
| Subject: | re: the database locking | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-13323@lists.php.net to get a copy of this message | ||
Here is the code that appears to work:
$result0 = mysql_query("LOCK TABLES COUNTER_Page_Views WRITE");
$result1 = mysql_query("UPDATE COUNTER_Page_Views SET Count = Count + 1
WHERE Counter_ID = '" . $count_id . "'");
$result2 = mysql_query("SELECT Count FROM COUNTER_Page_Views WHERE
Counter_ID = '" . $count_id . "'");
$result3 = mysql_query("UNLOCK TABLES;");
What I think I am running into is a wierd runtime thing between
javascript and the html on the page. I should be ok though, the lock
appears to work after reading over the MySQL stuff again.
Matt Babineau
Freelance Internet Developer
e: <mailto:mbabineau@illuminatistudios.com>
mbabineau@illuminatistudios.com
p: 603.943.4237
w: <http://www.illuminatistudios.com/> http://www.illuminatistudios.com