Line thats erroring.
Insertthree function.PHP Code:$res = insertthree("INSERT INTO usergroups (group_id, owner_id, group_name) VALUES ('%s', '%s, '%s')", 'null', $_SESSION["userid"], $groupname);
if($res != 'Added')
{
echo $res;
}
Error:PHP Code:function insertthree($query, $item1, $item2, $item3)
{
$querysafe = sprintf($query,
mysql_real_escape_string($item1),
mysql_real_escape_string($item2),
mysql_real_escape_string($item3));
mysql_query($querysafe) or die(mysql_error());
return 'Added';
}
I don't quiet see why its erroring, I don't see a error in my script but eh maybe I'm wrong.Code:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Test')' at line 1
Thanks in advanced.

