Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

Primary keys

Codes here !

Moderators: macek, egami, gesf

Primary keys

Postby infomorelos » Sun Feb 09, 2003 1:40 pm

I want to build my first tables and wonder:
1) can table/field names have white spaces and unlimited number of characters?
2) I call the table 'einheiten'. This table has about 25 fields which I?ve already created. I defined only one field as the primary key: 'id-key'. However, when creating the fields I left default settings like 'TINYINT'. When I changed this for the 'key' field to 'TINYTEXT' and it became a Primary Key, I didn't put any atention to this. However, when defining the 'logo' field as 'BLOB', it became Primary Key too, and when defining another field as 'TEXT', it became Primary as well.

I thought I should have only one Primary Key for each table.

Thank you in advance
infomorelos
New php-forum User
New php-forum User
 
Posts: 14
Joined: Mon Jan 27, 2003 12:10 am
Location: Cuernavaca, Mexico

Postby Joan Garnet » Mon Feb 10, 2003 4:49 pm

As you guessed it's only one primary key for table, should be unique,primary and autoincrement.

The tables I'm not sure about that...
I always use "_" instead of white spaces. Try it and see if it works :)
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

whitespaces

Postby infomorelos » Tue Feb 11, 2003 9:32 am

I tried and it seems to work , however, I'm concerned about possible compatiblity issues with PHP or XML....
infomorelos
New php-forum User
New php-forum User
 
Posts: 14
Joined: Mon Jan 27, 2003 12:10 am
Location: Cuernavaca, Mexico


Return to mySQL & php coding

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron