I'm using PHP and MySQL.
MySQL will not update the last cell in my table. I can't figure out why.
Basically, I do 10 INSERTs with a foreach() loop on an array. On each loop I use the following code:
$sql = "INSERT INTO table1 (name, address, phone, date_time, process_started, process_ended)
VALUES
('$name', '$address', '$phone', NOW(), 'started', '')";
$result = @mysql_query($sql, $con) or die(mysql_error());
That works fine; all the info inserts into the table.
Then when I go back through to update the "process_ended" field it updates just fine for the first 9 rows. But it will not update the "process_ended" cell of the 10th row.
Here is the code for the update. It does not use a loop; I just typed it into the script 10 times.
$sql = "UPDATE table1 SET process_ended = 'ended' WHERE name = '$name' && address = '$address'";
$result = @mysql_query($sql, $con) or die(mysql_error());
I have checked to make sure the name and address cells match up to what is in the script; and they do. I have also triple checked to make sure there are no typo's in my scripts.
I think this is something to do with MySQL because when I switch the order of the updates it's always the last cell that does not update. I have deleted the table and remade it and I also hit the repair DB button in cPanel and it says it's ok.