Good health to all. He did, did and got the 30 minute script work :( In the DB, the table has a product ($ X1), and it has 7 warehouses (A100-A700)
Maybe there is the possibility of optimizing this.
Maybe there is something more universal in SQL queries, which I do not know yet. What is this brute-force UPDATE by seven lines?
$result1 = mysql_query ("UPDATE $table SET $table.field_01='$A1', $table.field_02='$B1' WHERE $table.field_04='A100' and $table.field_05='$X'", $db); $result2 = mysql_query ("UPDATE $table SET $table.field_01='$A2', $table.field_02='$B2' WHERE $table.field_04='A200' and $table.field_05='$X'", $db); $result3 = mysql_query ("UPDATE $table SET $table.field_01='$A3', $table.field_02='$B3' WHERE $table.field_04='A300' and $table.field_05='$X'", $db); $result4 = mysql_query ("UPDATE $table SET $table.field_01='$A4', $table.field_02='$B4' WHERE $table.field_04='A400' and $table.field_05='$X'", $db); $result5 = mysql_query ("UPDATE $table SET $table.field_01='$A5', $table.field_02='$B5' WHERE $table.field_04='A500' and $table.field_05='$X'", $db); $result6 = mysql_query ("UPDATE $table SET $table.field_01='$A6', $table.field_02='$B6' WHERE $table.field_04='A600' and $table.field_05='$X'", $db); $result7 = mysql_query ("UPDATE $table SET $table.field_01='$A7', $table.field_02='$B7' WHERE $table.field_04='A700' and $table.field_05='$X'" $db);
Too this place to me, somehow, I don’t like it ... PS Corrected a bit, where there is $ X (it comes 1, for 7 records, then another, for the next 7)