Re: [PHP] LOCKS???

[email protected] (Tedd Sperling)
Newsgroups php.general
Message-ID <[email protected]>
> On Nov 27, 2016, at 11:33 PM, Paul M Foster <[email protected]> wrote:
> -snip-
> 
> Read what Tedd wrote again. The second script is reading and WRITING to
> the tables.
> 
> Paul
> 
> -- 
> Paul M. Foster
> http://noferblatz.com
> http://quillandmouse.com

Thanks Paul — you are correct.

As to what engine I am running, which one do I need to get LOCK TABLES  to work?

I have found and tested transactions that only work in a InnoDB engine, but I did not read anything about what engine is required for LOCKS to work. Is that an issue?

To restate the current problem.

I have two scripts accessed by two different computers (thus with different session ID’s).

a) Computer One runs the first script which executes a LOCK --

$query = "LOCK TABLES $table WRITE”;

— and then writes to the table. This is confirmed by inspecting the table via phpMyAdmin.

b) Computer two then runs the second script which only executes an UPDATE --:

$query = "UPDATE $table SET i='$i' WHERE id=1 “;

— and the value of i in $table is changed. This is also confirmed by inspecting the table via phpMyAdmin.

This experiment demonstrates that LOCK TABLES does not work for me.

My question is”Why?”

Cheers and thanks to all who answer.

tedd

_______________
tedd sperling
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.