mysql create table help

Associate
Joined
19 Apr 2006
Posts
35
Location
Blackpool
Hey all.

Im in need of a little help for planning my mysql table, basically i have a table called images, which contains image_id, image_name, image_file, i need image_id to be the primary/unique key.

Whats the best way to set the datatype so that i dont have to worry bout having too many images, as i imagine there *** be 1000's of records in it over time.

Ideally the image_id will be a auto-incremental value, will setting it as int do, or will i be limited to the max number a int can hold?

Thanks
Chris
 
Even if you use a datatype which later turns out to be too small for your requirements, a swift 'alter table' command can be used to change it without changing your data.

I'd go with an unsigned integer, primary key, not null, auto_increment.
 
Back
Top Bottom