First off, I know this script won't work. I need a to make the variable within the POST superglobal variable. I know you cannot do this conventionally, but are there any work arounds?
if ($_POST[status]=="add_log") {
$status_msg = "(Truck Log Submitted)";
$status_color = "#00FF00";
$blanks = ",''";
$count = 1;
$sql = "select * from truck_structure";
$result = mysql_query($sql,$conn) or die (mysql_error());
if ($count < mysql_num_rows($result)) {
$count = $count + 1;
$blanks .= $blanks;
}
$date_add = date("Y-m-d");
connDB();
$sql = "insert into truck_log values ('', '$date_add', '$_POST[driver]', 'xx'$blanks)";
mysql_query($sql,$conn) or die (mysql_error());
$sql9 = "select * from truck_structure";
$result9 = mysql_query($sql9,$conn) or die (mysql_error());
while ($newarray = mysql_fetch_array($result9)) {
$column = $newarray['labor_number'];
$var = "_POST[LN"."$column"."]";
$sql8 = "update truck_log set C$column = '$$var' where stat = 'xx'";
mysql_query($sql8,$conn) or die (mysql_error());
}
$sql7 = "update truck_log set stat = 'done'";
mysql_query($sql7,$conn) or die (mysql_error());
}