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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.