Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new to myphpadmin

Status
Not open for further replies.

maxelcat

Technical User
Oct 19, 2006
79
Hi all
Am attempting to set up my first database on a server

Server is running mysql 4.1.2 standalone and php4.2 and I have to use myphpadmin to adminsiter the database.

I have set the db up and have been tryong to get my first table. I keep getting this error.
When I was doing this on apache using the command line on my laptop I didn't have the collate/character set bit. I didn't really know what to choose, but googeling led me to my choice - perhpas its wrong???

Any ideas on how to proceed gratefully recieved

thanks
edward


Code:
Error
SQL query: 

CREATE TABLE `users` (

`user_id` VARCHAR( 16 ) UNSIGNED CHARACTER SET latin2 COLLATE latin2_general_ci NOT NULL ,
`first` VARCHAR( 15 ) UNSIGNED CHARACTER SET latin2 COLLATE latin2_general_ci NOT NULL 
) ENGINE = MYISAM CHARACTER SET latin2 COLLATE latin2_general_ci 

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 'UNSIGNED CHARACTER SET latin2 COLLATE latin2_general_ci NOT NULL, `first` VARCHA' at line 1
 
Are you manually writing the SQL or are you using the phpMyAdmin's "wizard" type item to create the table?
 
I was using the wizard to get that error

When I used the sql window and press "go" I get a blank screen and nothing happens...
 
I get the same error myself. I do belive that it's the "unsigned" attribute that's causing you issues. Any reason you need to use that attribute?
 
I'm not quite sure I understand what the unsigned attribute is for, however, I "think" that it's only for numeric values. Thus, trying to put "unsigned" when the character type is a VarChar would cause errors because a VarChar is not a numeric value. More info at Hope this helps.
 
thanks for your replies

Pretty silly really - the unsigned attribute is like you sy for numbers (it means sign as in postive or negative according to my book!) so unsigned can store up to a larger positve number. Signed goes between + and - half the max postive value for unsigned.

So, once I took the signed thing away from varchar it worked immediately!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top