Jump to content


PHPMyAdmin troubles

  • Please log in to reply
3 replies to this topic

#1 katechan

  • New Members
  • Pip
  • Newbie
  • 1 posts
  • LocationU.S.A

Posted 08 December 2003 - 04:14 AM

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.
- Kate

#2 Rheal

  • Members
  • PipPip
  • Member
  • 11 posts

Posted 11 December 2003 - 04:38 PM

Did you get this problem fixed???

#3 gizmola

  • Administrators
  • Advanced Member
  • 4,664 posts
  • LocationLos Angeles, CA USA

Posted 11 December 2003 - 08:59 PM

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.

#4 PHPcadet

  • Members
  • PipPip
  • Member
  • 14 posts
  • LocationPlant City, Florida

Posted 11 December 2003 - 10:19 PM

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.
If builders built buildings the way programmers write programs, then the first termite to come along would destroy civilization -- Anonymous

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users