Jump to content

Archived

This topic is now archived and is closed to further replies.

mbvo

auto incriment

Recommended Posts

I'm trying to display data that no one field is required to be unique, so I want to make an automatic field that contains a number.  but there's no auto incriment data type for sql.  what do i do?

Share this post


Link to post
Share on other sites
auto increment is not a datatype but rather an attribute. if you're wanting an auto incrementing column, just set it up in your create table statement like this:
[code]
CREATE TABLE myTable (
  id int(11) auto_increment primary key
  -- continue your table on here --
[/code]

Share this post


Link to post
Share on other sites
And you should make it UNSIGNED.

Share this post


Link to post
Share on other sites

×

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.