|
Posted by cdtsly on 12/11/78 11:50
Hi i have a table with all value at 4
i select all lines in a fetch
i update one with a value of 7
i update all the row in the fetch with a value 5
the result is that all my row are at 5
and the only line which should be at 7 is at 5 too.
i see that the problem is at the first mysql_db_query, and i don t know
how to solve it
thanks
$query="SELECT * FROM val WHERE str='4'";
$result=mysql_db_query($datamysql,$query);
$query7="UPDATE val SET str='7',updated='1' WHERE val='2'";
$result7=mysql_db_query($datamysql,$query7);
while ($row=mysql_fetch_array($result))
{
$str=$row["str"];
$val=$row["val"];
$query2="UPDATE val SET str='5' WHERE val='$val'";
$result2=mysql_db_query($datamysql,$query2);
}
Navigation:
[Reply to this message]
|