Rockonmetal
04-17-2008, 09:27 PM
I am having a problem with this table updating
The code should take the max id from the user and turn it into a variable though its not letting me do it...
$con = mysql_connect("localhost","admin","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("markmon_pureadd_upload", $con);
$result= mysql_query("SELECT MAX(ID) FROM pictures WHERE user='$user'");//Selects max ID from the specific user specified
while($row = mysql_fetch_array($result)){
mysql_query("UPDATE pictures SET status='102' WHERE ID='$result' AND user='$user'");
Now when I put in a value for id like id=1 it will update the status... but when i have it trying and do it with the variable... it won't...
Thanks!
The code should take the max id from the user and turn it into a variable though its not letting me do it...
$con = mysql_connect("localhost","admin","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("markmon_pureadd_upload", $con);
$result= mysql_query("SELECT MAX(ID) FROM pictures WHERE user='$user'");//Selects max ID from the specific user specified
while($row = mysql_fetch_array($result)){
mysql_query("UPDATE pictures SET status='102' WHERE ID='$result' AND user='$user'");
Now when I put in a value for id like id=1 it will update the status... but when i have it trying and do it with the variable... it won't...
Thanks!