Casalen Posted March 22, 2007 Share Posted March 22, 2007 I've never really used SQL. Right now I'm trying to install textual verification to PHPbb2. The script connects to the database, then tells me there's a syntax error in the following: CREATE TABLE phpbb_textual_confirmation (id INTEGER NOT NULL AUTO_INCREMENT, question TEXT NOT NULL, answers TEXT NOT NULL, PRIMARY KEY (id) ); INSERT INTO phpbb_textual_confirmation(question,answers) VALUES ('Are you human?', 'yes\nja\noui'); INSERT INTO phpbb_textual_confirmation(question,answers) VALUES ('Say hello', 'hello\nhi\nhallo'); Specifically, the first line. I've moved stuff around a bit in it to no avail, but I'm really not sure how this stuff is supposed to look yet. Quote Link to comment Share on other sites More sharing options...
Barand Posted March 22, 2007 Share Posted March 22, 2007 If you are trying to execute those sql statement from a PHP script then you need to use mysql_query() to cal the sql code. <?php $sql = "CREATE TABLE phpbb_textual_confirmation (id INTEGER NOT NULL AUTO_INCREMENT, question TEXT NOT NULL, answers TEXT NOT NULL, PRIMARY KEY (id) )" ; mysql_query($sql); $sql = "INSERT INTO phpbb_textual_confirmation(question,answers) VALUES ('Are you human?', 'yes\nja\noui')"; mysql_query($sql); $sql = "INSERT INTO phpbb_textual_confirmation(question,answers) VALUES ('Say hello', 'hello\nhi\nhallo')"; mysql_query($sql); ?> Quote Link to comment 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.