Jump to content

phpmyadmin table not being created


AcidDriver

Recommended Posts

SQL query:

 

CREATE TABLE `hope` (

 

`lname` TEXT NOT NULL ,

`fname` TEXT NOT NULL ,

`idnum` INT NOT NULL ,

`gradyear` INT NOT NULL ,

`donor` ENUM NOT NULL ,

`foh` ENUM NOT NULL ,

`org` TEXT NOT NULL ,

`fellow` ENUM NOT NULL ,

`sfellow` ENUM NOT NULL ,

`scholar` ENUM NOT NULL ,

`lreduce` ENUM NOT NULL ,

`address` TEXT NOT NULL ,

`city` TEXT NOT NULL ,

`state` TEXT NOT NULL ,

`zip` TEXT NOT NULL ,

`phone` TEXT NOT NULL ,

`waddress` TEXT NOT NULL ,

`wcity` TEXT NOT NULL ,

`wstate` TEXT NOT NULL ,

`wzip` TEXT NOT NULL ,

`wphone` TEXT NOT NULL ,

`fax` TEXT NOT NULL ,

`cphone` TEXT NOT NULL ,

`email` TEXT NOT NULL ,

`interests` ENUM NOT NULL ,

`project` ENUM NOT NULL ,

`liason` ENUM NOT NULL ,

`pliason` ENUM NOT NULL ,

`comtotalhours` INT NOT NULL ,

`comagency` TEXT NOT NULL ,

`comdate` TEXT NOT NULL ,

`comhours` INT NOT NULL ,

`adtotalhours` INT NOT NULL ,

`adagency` TEXT NOT NULL ,

`addate` TEXT NOT NULL ,

`adhours` INT NOT NULL ,

`adattorney` TEXT NOT NULL ,

`adattorneycon` TEXT NOT NULL ,

`userlanguage` ENUM NOT NULL

) ENGINE = MYISAM

 

MySQL said: 

 

#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 'NOT NULL, `foh` ENUM NOT NULL, `org` TEXT NOT NULL, `fellow` ENUM NOT NULL, `sfe' at line 1

Link to comment
Share on other sites

I assigned variables, and got this.

 

CREATE TABLE `hope` (

 

`lname` TEXT NOT NULL ,

`fname` TEXT NOT NULL ,

`idnum` INT( 10 ) NOT NULL ,

`gradyear` INT( 4 ) NOT NULL ,

`donor` ENUM( 1 ) NOT NULL ,

`foh` ENUM( 1 ) NOT NULL ,

`org` TEXT NOT NULL ,

`fellow` ENUM( 1 ) NOT NULL ,

`sfellow` ENUM( 1 ) NOT NULL ,

`scholar` ENUM( 1 ) NOT NULL ,

`lreduce` ENUM( 1 ) NOT NULL ,

`address` TEXT NOT NULL ,

`city` TEXT NOT NULL ,

`state` TEXT NOT NULL ,

`zip` TEXT NOT NULL ,

`phone` TEXT NOT NULL ,

`waddress` TEXT NOT NULL ,

`wcity` TEXT NOT NULL ,

`wstate` TEXT NOT NULL ,

`wzip` TEXT NOT NULL ,

`wphone` TEXT NOT NULL ,

`fax` TEXT NOT NULL ,

`cphone` TEXT NOT NULL ,

`email` TEXT NOT NULL ,

`interests` ENUM( 1 ) NOT NULL ,

`project` ENUM( 1 ) NOT NULL ,

`liason` ENUM( 1 ) NOT NULL ,

`pliason` ENUM( 1 ) NOT NULL ,

`comtotalhours` INT( 1000 ) NOT NULL ,

`comagency` TEXT NOT NULL ,

`comdate` TEXT NOT NULL ,

`comhours` INT( 1000 ) NOT NULL ,

`adtotalhours` INT( 1000 ) NOT NULL ,

`adagency` TEXT NOT NULL ,

`addate` TEXT NOT NULL ,

`adhours` INT( 1000 ) NOT NULL ,

`adattorney` TEXT NOT NULL ,

`adattorneycon` TEXT NOT NULL ,

`userlanguage` ENUM( 3 ) NOT NULL

) ENGINE = MYISAM

 

MySQL said: 

 

#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 '1) NOT NULL, `foh` ENUM(1) NOT NULL, `org` TEXT NOT NULL, `fellow` ENUM(1) NOT N' at line 1

Link to comment
Share on other sites

I just read the guidelines, sorry everyone for not adhering to them.

 

MySQL version 5.0.27

I need this table to be created so that the PHP code may communicate with the server.

It is not creating a table

I have clicked the save button many times, also added the length/values.

 

Thanks in advance

Link to comment
Share on other sites

ok, i have looked at the enum docs.  so ENUM(0,1) will have the 0 false and 1 true values in it.

 

 

How do i set that in phpmyAdmin?

 

 

no.

 

enum allows you to setup the column so only specified value can go into it. If you want 0 and 1 to be the only values allowed, then you'd do ( '0', '1' ). It has nothing to do with 0 false values and 1 true. You need to think about why you are making the column enumerated. Is it required that the column only be one of a few different choices? If not, just make it a varchar or an int

Link to comment
Share on other sites

Vefore anything further I would like to thank everyone for tagging along with a noob, especially dannyb785.

 

OK, so what I am trying to do with the enum ones is set it so that values from HTML are passed through php to be placed in thge table as true or false. MySQL does not have the boolean type(which would make life easier), so i am thinking of what to do.

 

I thought that using an int with 0 for false, and 1 for true would work, so I would use int, i guess...

 

But what happens in the case where I have PHP passing down something like this:

 

0 - Agency 1

1 - Agency 2

2 - Agency 3

 

Mike fulfills 0 and 2, so i pass down 0 and 2 to the table, so it is shown that he belongs to agency 1 and agency 3?

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.