i have this statement in a php file but keeps throwing up some error can someon eplease look over this code and get back to me with any morrections needed
Code:
$sql = "INSERT INTO `list` SET ";
$sql .= "`stamp`='" . sql_escape_string($stamp) . "', ";
$sql .= "`ip`='" . sql_escape_string($ip) . "', ";
$sql .= "`type`='" . sql_escape_string($type) . "', ";
$sql .= "`threat`='" . sql_escape_string($threat) . "', ";
$sql .= "`datetime`=now() ";
$r = sql_command($sql);
if ($r == 1) {
########################################
# good insertion, get record id number #
########################################
$id = sql_insert_id("list", "id");
return $id;
}
function sql_command ($sql) {
if (mysql_query($sql)) return mysql_affected_rows();
return -1;
}
function sql_insert_id($table, $field) {
return mysql_insert_id();
}
function sql_escape_string ($string) {
if (get_magic_quotes_gpc()) {
$string = stripslashes($string);
}
$string = mysql_real_escape_string($string);
return $string;
}
thank you