FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


indexes in MySQL





Neilos
Hi,

I have a MySQL database with tables and records all done (is's just a small test one). I want to index the records for ease of searching.

I have set up a unique index on a column called id.

When I create a record it looks for the highest number, adds 1, and makes this the new id number for that record. GREAT!

now I want to be able to use this ID as a serial number but I want all the numbers to be the same length. Say I want 6 digits (xxxxxx) is there a way to have 000001 as the first record? Or should I just start at 100001?

Thanks

Neilos
rvec
use the attribute "UNSIGNED ZEROFILL"
Related topics
mysql connection question
php admin and mysql admin console
Mysql And PHP HELP PLZ
Do you use a CMS script?
Question about MySQL!
PHP, MySQL...
PHP Book (Php and Mysql for Dynamic Web Sites)
few mysql questions
E-Cards with PHP & MySQL
HTTP AUTH with PHP and mySQL
Build an online dictionary by PHP/MySQL
Make search engine With PHP and mySQL, for your site
PHP without mySQL
Optimizing a mySQL database
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.