I have two tables pqcosts (with fields id, costs, ta) and pq (with fields including ta and costs)
The pqcosts table gets updated at various places but I want a page that will update the pq table when a page loads. The code I have tried so far is:
<?php
$query = mysql_query ("SELECT * FROM pqcosts WHERE id = β1β ");
while ($row = mysql_fetch_array ($query))
{
$id = $row['id'];
$ta = $row['ta'];
$cost = $row[βcostsβ];
}
mysql_query("UPDATE pq SET costs=$cost");
mysql_query("UPDATE pq SET ta='$ta'");
?>
But this doesn't work.
Can anyone help please?