Here is what I am trying to do.
//Insert the values into the correct database with the right fields
$result = $db->sql_query ("INSERT INTO " . $prefix . "_milpacs_members (uniqueid, u_name, uniform, rank_id, flag, location, status, p_mos, unit_id, reports, position, weapon_id, enlistment_dt, icq, bio)".
"VALUES ('NULL','$soldierName','$uniform', $rank_id, '$flag', '$location', '$status', '$p_mos', $unit_id, '$reports', '$position', $weapon_id, '$enlistment_dt', '$icq', '$bio')");
if (!$result) {
echo("<p>Error adding Soldier!" . mysql_error() . "</p>");
}
else {
$result = $db->sql_query($sql);
$id = $db->sql_query ("SELECT max(uniqueid) FROM " . $prefix . "_milpacs_members");
Header("Location: /milpacs.php?aop=editsoldier&uniqueid=$id");
}
I add the latest record in this table, then I want the page to direct to the editsoldier page to add other information. I need to use the id assigned to this record I just added. This doesn't work right now. My url says
?aop=editsoldier&uniqueid=Resource%20id%20#167
Any assistance is appreciated.