Primary keys

Codes here !

Moderators: macek, egami, gesf

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

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

User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

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 :)

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

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


Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 0 guests