Creating table error
Posted: Thu Oct 30, 2008 11:20 am
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
<?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