I get this error:
INSERT INTO collegiate (cid, user_id, first, last, year, age, gender, last_change) VALUES (NULL, , 'asdf', 'asdf', 'asd', '5', 'm', NOW())You have an error in your SQL syntax near ' 'asdf', 'asdf', 'asd', '5', 'm', NOW())' at line 1
when i submit a form here is the code that deals with the scripting. If anyone knows why i might be getting this syntax error that would be great. I have looked the code over but cant seem to find it. I either must be blind or stupid.
function add_runner($ident = "", $first = "", $last = "", $year = "", $age = "", $gender = "") {
$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));
echo $sql;
if (isset($_POST['profile_data'])) {
$update_profile->add_runner($_POST['id'], $_POST['first'], $_POST['last'], $_POST['year'], $_POST['age'], $_POST['gender']);
}