Q:

How to update 2 tables in mysql?

I would like to update two tables called: routing and routing_has_work_center
In routing table, user can edit the description while in routing_has_work_center table, user can edit the production_hour.
<?php
session_start();
// include a php file that contains the common database connection codes
include ("dbFunctions.php");

//retrieve computer details from the textarea on the previous page
$description = $_POST['description'];
$production_hour=$_POST['$production_hour'];

//retrieve id from the hidden form field of the previous page
$theID = $_POST['routing_id'];

$msg = "";

//build a query to update the table
//update the record with the details from the form
$queryUpdate = "UPDATE routing SET description='$description' WHERE     routing_id = $theID";

//execute the query
$resultUpdate = mysqli_query($link, $queryUpdate) or die(mysqli_error($link));

//if statement to check whether the update is successful
//store the success or error message into variable $msg
if ($resultUpdate) {
$msg = "Record updated successfully!";
} else {
$msg = "Record not updated!";
}
?>

I have this the code above but when I update the production hour, it remains the same and is not updated at routing_has_work_center database.
Do I have to add something else to the query?

A:

Check this.
$queryUpdate = "UPDATE routing_has_work_center SET production_hour='$production_hour' WHERE routing_id = '$theID' ";

