Jump to content

PHPMyAdmin troubles


katechan

Recommended Posts

I\'m unbelieveably new to this, and I\'m just now starting to actually try and USE the stuff in PHPMyAdmin for my web site. Point for saying this is this: Please don\'t spit programmer jargon at me. It\'s not helpful.

 

My problem is this. I\'ve tried to make tables, but to no avail. I fill in the names of the columns, I pick out a type, I actually know what the types mean, I fill in a length, and I make a primary key. According to this one tutorial I\'m going off of, you don\'t need any more than that to create a basic table. Click the save button, and everythings OK, right?

 

Wrong. PHPMyAdmin keeps hacking up errors in the generated SQL syntax that I haven\'t the slightest clue how to fix, though I have tried changing my methods of entering stuff. The code looks like this-

CREATE TABLE `Character Names` (



`Name` TINYTEXT( 20 ) NOT NULL ,

`Male or Female` ENUM( \'male\', \'female\', \'either\' ) NOT NULL ,

`Meaning` TINYTEXT( 150 ) NOT NULL ,

PRIMARY KEY ( `Name` ) 

) 

 

The error looks like this.

 

MySQL said:  

 

 

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 \'(20) NOT NULL, `Male or Female` ENUM(\'male\',\'female\',\'either\')

 

I\'ll give you a hug if you can help me. This is extremely aggravating.

Link to comment
Share on other sites

I can\'t guarantee this is your problem, but you should not use spaces in the names of your columns. You might try to substitute the name gender instead of \'Male or Female\'. Keep in mind that column names in your table are for your use only... nobody sees these, so keeping them simple and descriptive enough for your use is all that\'s necessary.

Link to comment
Share on other sites

It seems like MySQL doesn\'t allow you to specify a length for TINYTEXT types. I tried it without the length, but then got another error stating that the primary key didn\'t have a length. So I changed the \'Name\' column to type VARCHAR and specified the length of 20 and it worked ok. Hope this fixes your problem.

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.