Select only on record?
Posted: Tue Feb 02, 2010 1:31 pm
Hi to all.
I have a table with 13g record, and they're 20 user selecting record from that specific table.
Some time when they are selecting record, the same record appear in 2,3,4,5 user at the same time.
I neet something that when a record is select it for one user could not be select from other at the same time, but with giving lock record or any thing like that.
there is something in the select-sql that could prevent this to happens?
this is my sql-selete command:
$result = mysql_query("SELECT * FROM customer WHERE isnewclient='NL' and iduser='') ", $link);
immediately i update the record:
$phone_number=$row[1];
$result = mysql_query("UPDATE customer SET iduser='$username' WHERE phone_number='$phone_number'") or die(mysql_error());
but any way more than 1 people is getting duplicate
thanks in advance
I have a table with 13g record, and they're 20 user selecting record from that specific table.
Some time when they are selecting record, the same record appear in 2,3,4,5 user at the same time.
I neet something that when a record is select it for one user could not be select from other at the same time, but with giving lock record or any thing like that.
there is something in the select-sql that could prevent this to happens?
this is my sql-selete command:
$result = mysql_query("SELECT * FROM customer WHERE isnewclient='NL' and iduser='') ", $link);
immediately i update the record:
$phone_number=$row[1];
$result = mysql_query("UPDATE customer SET iduser='$username' WHERE phone_number='$phone_number'") or die(mysql_error());
but any way more than 1 people is getting duplicate
thanks in advance