Creating table error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bob_wait
Forum Newbie
Posts: 1
Joined: Thu Oct 30, 2008 11:15 am

Creating table error

Post by bob_wait »

Hi php experts, When i ran this code, this is the error i am getting "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 '`high`,`medium`,`low`) NOT NULL, subject VARCHAR(50) NOT NU". Kindly help.

<?php
include 'library/config.php';
include 'library/opendb.php';
$query="CREATE TABLE IF NOT EXISTS `_SUPPORT_DB_TABLE` (
id int NOT NULL AUTO_INCREMENT,
severity_level enum(`high`,`medium`,`low`) NOT NULL,
subject VARCHAR(50) NOT NULL,
description text,
submitted_by INT NOT NULL,
submitted_date DATETIME NOT NULL,
status enum(`open`, `closed`) NOT NULL,
PRIMARY KEY (id)
)";
mysql_query($query)or die(mysql_error());
include 'library/closedb.php';
?>

thanks,
Bob
User avatar
novice4eva
Forum Contributor
Posts: 327
Joined: Thu Mar 29, 2007 3:48 am
Location: Nepal

Re: Creating table error

Post by novice4eva »

rather than using ` try '(single quote)
Post Reply