i used this code:
function save_profile_date($ident = "", $first = "", $last = "", $year = "", $age = "", $gender = "") {
if ($_SESSION['is_rec']) {
$sql = sprintf("UPDATE %s SET first=%s, last=%s, year=%s, age=%s, gender=%s, last_change=NOW() WHERE cid = %s AND user_id = %s",
PROFILE_TABLE, $this->ins_string($first), $this->ins_string($last), $this->ins_string($year),
$this->ins_string($age), $this->ins_string($gender), $this->ins_string($ident, "int"), $_SESSION['user_id']);
printf("UPDATE %s SET first=%s, last=%s, year=%s, age=%s, gender=%s, last_change=NOW() WHERE cid = %s AND user_id = %s",
PROFILE_TABLE, $this->ins_string($first), $this->ins_string($last), $this->ins_string($year),
$this->ins_string($age), $this->ins_string($gender), $this->ins_string($ident, "int"), $_SESSION['user_id']);
} else {
$sql = sprintf("INSERT INTO %s (cid, user_id, first, last, year, age, gender, last_change) VALUES (NULL, %s, %s, %s, %s, %s, %s, NOW())",
PROFILE_TABLE, $_SESSION['user_id'], $this->ins_string($first), $this->ins_string($last),
$this->ins_string($year), $this->ins_string($age), $this->ins_string($gender));
printf("INSERT INTO %s (cid, user_id, first, last, year, age, gender, last_change) VALUES (NULL, %s, %s, %s, %s, %s, %s, NOW())",
PROFILE_TABLE, $_SESSION['user_id'], $this->ins_string($first), $this->ins_string($last),
$this->ins_string($year), $this->ins_string($age), $this->ins_string($gender));
}
if (mysql_query($sql) or die (mysql_error())) {
$this->profile_id = (!$_SESSION['is_rec']) ? mysql_insert_id() : $ident;
$this->the_msg = $this->extra_text(2);
} else {
$this->the_msg = $this->extra_text(3);
}
}
and this is what printed to the scree: You have an error in your SQL syntax near '' at line 1