Re: How to remove muiltiple queries to a table at the same time
Hi all, I am using PHP and what i know is that without select statement in the query we can not fetch anything . I mean if we do not give select what will be the field headers. Pl. clarify how can we fetch rfom this query. UPDATE `table_name` SET `field`=`field`+1; Also can we lock and unlock tables in MySQL 4.x apart from 5.x . Expecting your reply thanks, -- Regards Abhishek Jain On 4/15/06, Puiu Hrenciuc <[EMAIL PROTECTED]> wrote: > > 1. A single query that fetvhes a value, increases it and save it : > > UPDATE `table_name` SET `field`=`field`+1; > > 2. You can lock tables, make updates an then unlock them, the > other processes will wait the table to be unlocked before running > their queries : > > LOCK TABLES `table_name` WRITE; > {SQL statements here} > UNLOCK TABLES; > > See also : http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html > > > ""abhishek jain"" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > Dear Friends, > I run several processes and they need to query the mysql 5.0.8 database > simultaneously .I have a config table which have the record id. I need to > fetch that and increment that .What I feel that the same record id is > fetched by different simultaneosly before i update .Can anyone help me in > either: > 1)telling me a single query which will fetch and incr. in the same query. > so > the problem of simultaneously queries are solved. > 2)A system by which delaying the other queries are done, I use PHP . > Expecting a quick reply. > Thanks, > Abhishek Jain > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] > >
Re: How to remove muiltiple queries to a table at the same time
1. A single query that fetvhes a value, increases it and save it : UPDATE `table_name` SET `field`=`field`+1; 2. You can lock tables, make updates an then unlock them, the other processes will wait the table to be unlocked before running their queries : LOCK TABLES `table_name` WRITE; {SQL statements here} UNLOCK TABLES; See also : http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html ""abhishek jain"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Dear Friends, I run several processes and they need to query the mysql 5.0.8 database simultaneously .I have a config table which have the record id. I need to fetch that and increment that .What I feel that the same record id is fetched by different simultaneosly before i update .Can anyone help me in either: 1)telling me a single query which will fetch and incr. in the same query. so the problem of simultaneously queries are solved. 2)A system by which delaying the other queries are done, I use PHP . Expecting a quick reply. Thanks, Abhishek Jain -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
How to remove muiltiple queries to a table at the same time
Dear Friends, I run several processes and they need to query the mysql 5.0.8 database simultaneously .I have a config table which have the record id. I need to fetch that and increment that .What I feel that the same record id is fetched by different simultaneosly before i update .Can anyone help me in either: 1)telling me a single query which will fetch and incr. in the same query. so the problem of simultaneously queries are solved. 2)A system by which delaying the other queries are done, I use PHP . Expecting a quick reply. Thanks, Abhishek Jain