note 14869 deleted from function.mysql-insert-id by sander
| From: | sander@php.net | Date: | Sat, 18 May 2002 07:17:03 +0000 |
| Subject: | note 14869 deleted from function.mysql-insert-id by sander | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-30794@lists.php.net to get a copy of this message | ||
No, mysql_insert_ID() does not add zerofill. To fix:
$ID = mysql_insert_ID();
$ID = str_repeat("0", $sp - strlen($ID)).$ID;
** $sp is the max number of digits your ID column has (eg. INT(11) would yield $sp = 11)