Thanks Scott I think this will help, will let you know how it comes out.

Matt Babineau
Freelance Internet Developer
e: [EMAIL PROTECTED] 
p: 603.943.4237
w: http://www.illuminatistudios.com
 


-----Original Message-----
From: Scott Hurring [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, April 25, 2002 2:52 PM
To: Php-Win (E-mail)
Subject: RE: [PHP-WIN] re: making a DB counter


Try this:
http://www.mysql.com/doc/L/O/LOCK_TABLES.html

That seems to be what you're asking for...
to lock down the table while you select, 
then update... 

---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515

> -----Original Message-----
> From: Matt Babineau [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 25, 2002 2:41 PM
> To: 'Php-Win (E-mail)'
> Subject: [PHP-WIN] re: making a DB counter
> 
> 
> Here is a snip of my code
>  
> $query = "SELECT Count FROM COUNTER_Page_Views WHERE Counter_ID = '" .

> $count_id . "' FOR UPDATE"; $query1 = "UPDATE COUNTER_Page_Views SET 
> Count = Count + 1 WHERE Counter_ID = '" . $count_id . "'";
> $result = mysql_query($query);
> $result1 = mysql_query($query1);
>  
> what is happeneing is that seesion are colliding in between these 
> queries, I need to somehow single thread this section of code. Is that

> possible? MySQL says that you can lock rows for updating but it only 
> seems to work when the queries are in the same code block, not when 
> executed separately. Anyone have a solution to making an update to a 
> record without having other users make an update in the middle of a 
> different users' process?
>  
> Matt Babineau
> Freelance Internet Developer
> e:  <mailto:[EMAIL PROTECTED]>
> [EMAIL PROTECTED]
> p: 603.943.4237
> w:  <http://www.illuminatistudios.com/> 
http://www.illuminatistudios.com
 
 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to