Code: Select all
//generate applications drop down
$query_apps = "SELECT * FROM application ORDER BY app_name";
$result_apps = mysql_query($query_apps);
if(!$result_apps) {
echo "<td>Could not get applications!</td>";
exit;
}
if(mysql_num_rows($result_apps) == 0) {
echo "<td><font class='small'>No applications setup - go to the <a href='app_entry.php'>Applications</a> page to setup.</font></td>";
exit;
}
else {
echo "<td>";
echo "<select name='app_idї]' size='5' multiple>";
while($row = mysql_fetch_array($result_apps)) {
echo "<option value='".$rowї0]."'>".$rowї1]."</option>";
}
echo "</select>";
echo "</td>";
}Code: Select all
$kb_record_id = makeUniqID();
//if ok, insert into db's
$querya = "INSERT INTO kb_record (kb_record_id, question, resolution, tbd_manual, comp_manual, dateadd_manual, tbd_help, comp_help, dateadd_help, tbd_website, comp_website, dateadd_website, internal, recordno, date_entered, date_modified) VALUES ('$kb_record_id', '$question', '$resolution', '$man_tbd', '$man_comp', '$man_date', '$help_tbd', '$help_comp', '$help_date', '$web_tbd', '$web_comp', '$web_date', '$int_use', '$record_no', '$ent_date', '$mod_date')";
$resulta = mysql_query($querya);
if (!$resulta) {
echo "Could not insert the record!";
exit;
}
$count = count($app_id);
for ($i=0; $i<$count; $i++) {
$queryb = "INSERT INTO complete_record (kb_record_id, app_id, cat_id, orig_user) VALUES ('$kb_record_id', '$app_idї$i]', '$cat_id', '$orig_user')";
$resultb = mysql_query($resultb);
}
if (!$resultb) {
echo $app_idї$i];
echo "Could not create record!";
exit;
}