Re: lock tables problem
| From: | Chris Murley | Date: | Tue, 08 Aug 2000 19:50:05 +0000 |
| Subject: | Re: lock tables problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-10776@lists.php.net to get a copy of this message | ||
Ahh, thats right.... but unless you are gettign thousands of hits a
second, that shouldnt be a problem for you. In any case if you still wish
to try and lock tables...
try mysql_query("lock table table1 read");
Good luck
On Wed, 9 Aug 2000, Mark Lo wrote:
> ok
>
> <form action="inseting.php" method="post">
> <? require("password.php");
> mysql_select_db("database");
> $query="select first, second from table1";
> $result=mysql_query($query);
> $a=0;
> <input type="select" name="xxxxx">
> while ($row=mysql_fetch_objects($result))
> { $first[]=($row->first);
> $second[]=($row->second);
> print("<option
> value='$first[$a]'>$second[$a]</option>");
> $a++;
> }
>
> </form>
>
> then in the page of inserting.php
>
> <?require("Password.php");
> mysql_select_db("database");
> $query="insert into table2 values ("$xxxxx");
> ------okay------ in the meantime of submitting page1 and exec
> inserting.php. Anyone updated the table1, I will get the different values
> in table2. Is that right!! So I just don't want this to be happened.
>
> Thank You
>
> mark Lo
>
> ----- Original Message -----
> From: Chris Murley <murley@appindex.net>
> To: Mark Lo <markloky@netvigator.com>
> Cc: php general <php-general@lists.php.net>; <mysql@lists.mysql.com>
> Sent: Wednesday, August 09, 2000 3:35 AM
> Subject: Re: [PHP] lock tables problem
>
>
> > I dont quite follow you, but you shoudnl't need to lock the tables
> > selecting inserting and updating... can you give me some more example
> > code? of inserting.php and the form?
> >
> > On Wed, 9 Aug 2000, Mark Lo wrote:
> >
> > > but the action page like <form method="post"
> > > action="inserting.php">
> > > ....this action pages require the information display in the first page
> > > without being updated or deleted or inserted.
> > >
> > >
> > > ----- Original Message -----
> > > From: Chris Murley <murley@appindex.net>
> > > To: Mark Lo <markloky@netvigator.com>
> > > Cc: php general <php-general@lists.php.net>; <mysql@lists.mysql.com>
> > > Sent: Wednesday, August 09, 2000 3:28 AM
> > > Subject: Re: [PHP] lock tables problem
> > >
> > >
> > > > You shouldnt have to, mysql will automagically lock and unlock them
> when
> > > > doing an insert/update.
> > > >
> > > >
> > > >
> > > > On Wed, 9 Aug 2000, Mark Lo wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > I need to lock the tables because I need inserting and updating
> > > later.
> > > > >
> > > > > like ....<form action="inserting.php"
> > > > > method="post">...i will do the
> > > > > insserting once i hit the submit button....
> > > > >
> > > > > Any Ideas of how to lock a specific table.
> > > > >
> > > > > Thank You
> > > > >
> > > > > Mark
> > > > >
> > > > >
> > > > > ----- Original Message -----
> > > > > From: Chris Murley <murley@appindex.net>
> > > > > To: Mark Lo <markloky@netvigator.com>
> > > > > Cc: php general <php-general@lists.php.net>;
> > > > > <mysql@lists.mysql.com>
> > > > > Sent: Wednesday, August 09, 2000 3:22 AM
> > > > > Subject: Re: [PHP] lock tables problem
> > > > >
> > > > >
> > > > > > Why would you need to lock the table to do a select?
> > > > > >
> > > > > >
> > > > > > mysql usually only locks when inserting/updateing?
> > > > > >
> > > > > >
> > > > > >
> > > > > > On Wed, 9 Aug 2000, Mark Lo wrote:
> > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > my script is as follows (once I lock the table1, i won't
> > > > > > > be
> able
> > > to
> > > > > read table2)
> > > > > > > what is the problems;
> > > > > > >
> > > > > > > require("Password.hlh");
> > > > > > > mysql_select_db("database1");
> > > > > > > mysql_query("lock tables table1 read");
> > > > > > > $query="select * from table1";
> > > > > > >
> > > > > > >
> > > > > > > then---the problem starts here...
> > > > > > >
> > > > > > > require("Password.hlh");
> > > > > > > mysql_select_db("database1");
> > > > > > > mysql_query("lock tables table2 read");
> > > > > > > $query="select * from table2";
> > > > > > >
> > > > > > > ---unable to select from table2---
> > > > > > >
> > > > > > > Can anyone please point me out the problems.
> > > > > > >
> > > > > > > Thank you so much
> > > > > > >
> > > > > > > Mark
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > > > For additional commands, e-mail: php-general-help@lists.php.net
> > > > To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
> > > >
> > > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
>