Hi again and thanks for all your help.
If I run the following query I get a result containing three records with all fields populated.
SELECT cd.flightid, cd.record_status, fd.id, fd.stat FROM flight_data_client cd , flightdata fd WHERE cd.flightid = fd.id
So I know that there is data.
If I continue to run the script(see below) I get the following:
UPDATE flight_data_client SET record_status=NULL WHERE =
UPDATE flight_data_client SET record_status=NULL WHERE =
UPDATE flight_data_client SET record_status=NULL WHERE =
The script is:
mysql_select_db($database_flightdata, $flightdata);
$query_flightdata = "SELECT cd.flightid, cd.record_status, fd.id, fd.stat FROM flight_data_client cd , flightdata fd WHERE cd.flightid = fd.id ";
$flightdata = mysql_query($query_flightdata, $flightdata) or die(mysql_error());
$totalRows_flightdata = mysql_num_rows($flightdata);
while ( $row = mysql_fetch_assoc( $flightdata ) ) {
$stat = empty( $row_flightdata['stat'] )? 'NULL' : $row_flightdata['stat']; // make sure this stat havea value
$sql = "UPDATE flight_data_client SET record_status=$stat WHERE " . $row_flightdata['id'] . " = " . $row_flightdata['flightid'] ;
echo "$sql<br />"; // test the last one and the first one in phpmyadmin...
// mysql_query($sql) or die(mysql_error());
}
Can I take from the output that the data is not being passed, or is there something wrong with the code.
Many thanks again for any help you can give me.