Jump to content

Problem with CREATE TABLE IF NOT EXISTS


shamuraq

Recommended Posts

Hi guys,

I have been using the "CREATE TABLE IF NOT EXISTS" with no problem until today... It keeps on giving me error. So i logged in to my phpMyAdmin to test it out on the sql console and it responded with

#1064 - 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 '"CREATE TABLE IF NOT EXISTS `email@email.com` ( `id` INT( 7 ) NOT NULL AUTO_IN' at line 1

 

this is the syntax that i used on phpMyAdmin:

"CREATE TABLE IF NOT EXISTS `email@email.com` (
	`id` INT( 7 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
	`ref` VARCHAR ( 200 ) NOT NULL ,
	`date` VARCHAR(10) NOT NULL ,
	`time` VARCHAR(10) NOT NULL ,
	`action` TEXT  ,
	`score` VARCHAR(4),
	`credit_charge` INT( 4 ) NOT NULL ,
	) ENGINE = innodb;";

 

i referred to the error that phpMyAdmin returned (error #1064) and found out it highly likely the usage of reserved keyword (http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html). But i cannot find any reserved keyword that i could've used in my query so far...

 

Any ideas?

Link to comment
Share on other sites

I once worked at a company that created a database for every user.... wow....

 

If you create a table for every user or in my case it was a database, every time you change the table/database you will need to change ALL of them, not just one, and if you forget to change one then the person that owns that table/database will get lots of errors, and you will have a mess on you hands.

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.