Forum Moderators: coopster
Also I tried the regular way that all the books suggest of INSERTING INTO a table and that never worked. Then I came across a post (forum88/322) in this forum that tipped me off to using the ('".mysql_escape_string($_REQUEST['value'])."')"; and that worked great for getting the data into the tables. That's when I decided to join this forum.
If anyone can help I would really appreciate it. My script looks like this:
//Add the incident to the incidents table.
$query = "INSERT INTO incidents (filed_by, first_name, last_name)
VALUES ('".mysql_escape_string($_REQUEST['filed_by'])."',
'".mysql_escape_string($_REQUEST['first_name'])."',
'".mysql_escape_string($_REQUEST['last_name'])."')";
if(!mysql_query($query) ) {
print "Error with query: \"$query\"<br />".mysql_error();
// Simple error handling...
}
$incident_id = mysql_insert_id()
$query = "INSERT INTO police (call_made, call_time, incident_id) VALUES (
'".mysql_escape_string($_REQUEST['call_made'])."', '".mysql_escape_string($_REQUEST['call_time'])."' , '".mysql_escape_string($_REQUEST['incident_id'])."')";
if(!mysql_query($query) ) {
print "Error with query: \"$query\"<br />".mysql_error();
// Simple error handling...
}
//Add the incident to the incidents table.
$query = "INSERT INTO incidents (filed_by, first_name, last_name)
VALUES ('".mysql_escape_string($_REQUEST['filed_by'])."',
'".mysql_escape_string($_REQUEST['first_name'])."',
'".mysql_escape_string($_REQUEST['last_name'])."')";
if(!mysql_query($query) ) {
print "Error with query: \"$query\"<br />".mysql_error();
// Simple error handling...
}
$incident_id = mysql_insert_id()
$query = "INSERT INTO police (call_made, call_time, incident_id) VALUES (
'".mysql_escape_string($_REQUEST['call_made'])."', '".mysql_escape_string($_REQUEST['call_time'])."' , '".mysql_escape_string($incident_id)."')";
if(!mysql_query($query) ) {
print "Error with query: \"$query\"<br />".mysql_error();
// Simple error handling...
}