Re: [PHP] Locking mysql tables with PHP

2003-11-25 Thread Marek Kilimajer
Wouter van Vliet wrote: I may be wrong here, but doesn't PHP let MySQL retain the locks when you've connected with the mysql_pconnect(); function? (persistent connect, I would expect locks to get released on a disconnect, which usually happens on a page refresh (new mysql_connect() call). That is o

RE: [PHP] Locking mysql tables with PHP

2003-11-25 Thread Wouter van Vliet
Marek Kilimajer wrote: > Tony Crockford wrote: >> Hi >> >> bit confused! >> >> here's what I want to do: >> >> get a numeric value from a MySQL table, do a calculation, then on >> another PHPpage update the numeric value in the table. >> >> what I don't want is anyone else getting the same numb

Re: [PHP] Locking mysql tables with PHP

2003-11-25 Thread Tony Crockford
On Tue, 25 Nov 2003 07:47:58 -0600, Jay Blanchard <[EMAIL PROTECTED]> wrote: [snip] [snip] is there a way I can get a number and increment it all in one query then? [/snip] UPDATE tblFoo SET value = (value+1) WHERE conditions Hmm.. my bad - I get that bit, but can I do: SELECT value WHERE condi

RE: [PHP] Locking mysql tables with PHP

2003-11-25 Thread Jay Blanchard
[snip] > is there a way I can get a number and increment it all in one query > then? > > UPDATE tblFoo SET value = (value+1) WHERE conditions > Hmm.. my bad - I get that bit, but can I do: SELECT value WHERE conditions UPDATE tblfoo SET value= (value+1) [/snip] I see where the confusion may be

RE: [PHP] Locking mysql tables with PHP

2003-11-25 Thread Jay Blanchard
[snip] > [snip] > is there a way I can get a number and increment it all in one query > then? > [/snip] > > UPDATE tblFoo SET value = (value+1) WHERE conditions > Hmm.. my bad - I get that bit, but can I do: SELECT value WHERE conditions UPDATE tblfoo SET value= (value+1) [/snip] Essentially tha

Re: [PHP] Locking mysql tables with PHP

2003-11-25 Thread pete M
UPDATE tblfoo SET value= (value+1) WHERE conditions Tony Crockford wrote: On Tue, 25 Nov 2003 07:15:10 -0600, Jay Blanchard <[EMAIL PROTECTED]> wrote: [snip] is there a way I can get a number and increment it all in one query then? [/snip] UPDATE tblFoo SET value = (value+1) WHERE conditions

Re: [PHP] Locking mysql tables with PHP

2003-11-25 Thread Tony Crockford
On Tue, 25 Nov 2003 07:15:10 -0600, Jay Blanchard <[EMAIL PROTECTED]> wrote: [snip] is there a way I can get a number and increment it all in one query then? [/snip] UPDATE tblFoo SET value = (value+1) WHERE conditions Hmm.. my bad - I get that bit, but can I do: SELECT value WHERE conditions U

RE: [PHP] Locking mysql tables with PHP

2003-11-25 Thread Jay Blanchard
[snip] is there a way I can get a number and increment it all in one query then? UPDATE tblFoo SET value = (value+1) WHERE conditions [/snip] OR (forgot the PHP part) $sqlUpdate = "UPDATE tblFoo SET value = (value + $variable) WHERE conditions "; if(!($dbUpdate = mysql_query($sqlUpdate, $connect

RE: [PHP] Locking mysql tables with PHP

2003-11-25 Thread Jay Blanchard
[snip] is there a way I can get a number and increment it all in one query then? [/snip] UPDATE tblFoo SET value = (value+1) WHERE conditions -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Locking mysql tables with PHP

2003-11-25 Thread Tony Crockford
On Tue, 25 Nov 2003 13:50:36 +0100, Marek Kilimajer <[EMAIL PROTECTED]> wrote: Tony Crockford wrote: get a numeric value from a MySQL table, do a calculation, then on another PHPpage update the numeric value in the table. what I don't want is anyone else getting the same number from the table

Re: [PHP] Locking mysql tables with PHP

2003-11-25 Thread Marek Kilimajer
Tony Crockford wrote: Hi bit confused! here's what I want to do: get a numeric value from a MySQL table, do a calculation, then on another PHPpage update the numeric value in the table. what I don't want is anyone else getting the same number from the table before I've updated it. what PHP w