ASP Forum
MySQL autonumber
kidz | Posted 7:57am 25. January 2005 Server Time |

In MySQL db, how to make my User_ID autonumber like in MS Access???
steven290 | Posted 8:07am 25. January 2005 Server Time |

i usually use a gui to make the dbase - try downloading the trial version of navicat.com then add a new field, make the type bigint, auto increment, primary key
findel | Posted 8:07am 25. January 2005 Server Time |

When viewing the table in Edit mode (in MySQL Control Center), make sure the Data Type of the field is 'int', length should be in the region of 11, and you need to tick the AUTO_INCREMENT box.
findel | Posted 8:09am 25. January 2005 Server Time |

oh yeah (as steven said) and make it the primary key (if thats what you want).
kidz | Posted 8:18am 25. January 2005 Server Time |

yah I'm using the trial version of Navicat.. now trying out.. so does unchecking "Allow Null" have any effect on my table? Can leave decimals blank or not?
steven290 | Posted 8:20am 25. January 2005 Server Time |

you need to leave allow null uncheck for autonumber and i would check for other fields
kidz | Posted 8:24am 25. January 2005 Server Time |

Why i always cannot save my table?

It say..

1064 - You have any error in your SQL Syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(255)' not null comment"
, Primary Key (User_ID)
)' at Line 7
steven290 | Posted 8:34am 25. January 2005 Server Time |

double check yourself - make sure the
id field: bigint type, allow null uncheck, auto increment checked primary key checked

all others place a check in allow null and make longtext
steven290 | Posted 8:37am 25. January 2005 Server Time |

you could also click the query button then new query then under sql paste this
create table tablename (id bigint auto_increment primary key, field1 longtext, field2 longtext, field3 longtext)

etc. then just change to what names you want
steven290 | Posted 8:38am 25. January 2005 Server Time |

make sure you hit save > then run the query now go bakc to your table view and doouble click you database  >  you should now see the new table
steven290 | Posted 8:39am 25. January 2005 Server Time |

go into the chatshop - i can walk you step by step
Woodrow | Posted 6:19am 13. August 2009 Server Time |

Hi Steven. Just came across this and I too am having a few issues, you seem to be clued up in this area, could I trouble you for a little help :) Thanks.


Reply to Post MySQL autonumber



Back to Forum Page