sstangle73 Posted August 13, 2007 Share Posted August 13, 2007 function addNew9schb($Type){ global $conn; $q3 = "INSERT INTO users WHERE ID = '$ID' VALUES ('NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', '$Type')"; if ($result = mysql_query($q3,$conn)) { return $result3; } else { die(mysql_error() . "<br />" . $q3); } } ... $_SESSION['cresult2'] = addNew9schb($type); results with. 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 'WHERE ID = '' VALUES ('NULL', 'NULL', 'NULL', 'NULL', 'NULL', ' INSERT INTO users WHERE ID = '' VALUES ('NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', '9Per') Quote Link to comment https://forums.phpfreaks.com/topic/64684-solved-mysql-entry/ Share on other sites More sharing options...
micah1701 Posted August 13, 2007 Share Posted August 13, 2007 when a record already exisits, you don't INSERT you UPDATE you want something like: UPDATE table SET column1 = 'value1', column2 = 'value2', WHERE ID = '$ID' Quote Link to comment https://forums.phpfreaks.com/topic/64684-solved-mysql-entry/#findComment-322532 Share on other sites More sharing options...
sstangle73 Posted August 13, 2007 Author Share Posted August 13, 2007 oh right its updateing thanks. let me see if that works Quote Link to comment https://forums.phpfreaks.com/topic/64684-solved-mysql-entry/#findComment-322534 Share on other sites More sharing options...
sstangle73 Posted August 13, 2007 Author Share Posted August 13, 2007 haha waht a nOOb mistake thanks Quote Link to comment https://forums.phpfreaks.com/topic/64684-solved-mysql-entry/#findComment-322536 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.