Jump to content

syntax error with mysql_query("CREATE TABLE...


sthealth

Recommended Posts

hello,

im writing an application form for a warcraft guild website which will insert the submitted field details into a mysql database.

when writing the script to setup this database i get a '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 '' at line 20'.

following is the code and im not sure what is causing this error.

thanks in advance for any assistance.

 

 

<html>
<head>
<title>Database setup</title>
</head>

<body>

<?php

// Connects to your Database - NB: real mysql info not displayed for question purpose
mysql_connect("xxxxx", "xxxxx", "xxxxx") or die(mysql_error()); 
mysql_select_db("xxxxx") or die(mysql_error()); 

// setup table

mysql_query("CREATE TABLE appl(
id INT NOT NULL AUTO_INCREMENT, 
PRIMARY KEY(id),
name VARCHAR(250),
class VARCHAR(250),
race VARCHAR(250),
level INT,
age INT,
email VARCHAR(250),
time VARCHAR(250),
hours VARCHAR(250),
karazhan VARCHAR(250),
pone VARCHAR(250),
skillone INT,
ptwo VARCHAR(250),
skilltwo INT,
firstaid VARCHAR(250),
gear VARCHAR(250),
talent VARCHAR(250),
whyjoin VARCHAR(250)")
or die(mysql_error()); 

?>

</body>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.