RE: [PHP-DB] Zeropadding
| From: | Gurhan Ozen | Date: | Tue, 14 May 2002 20:30:11 +0000 |
| Subject: | RE: [PHP-DB] Zeropadding | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-19183@lists.php.net to get a copy of this message | ||
SELECT LPAD(column_name, '6', '0') FROM table_name;
Gurhan
-----Original Message-----
From: Morten Nielsen [mailto:mosgaard2000@hotmail.com]
Sent: Tuesday, May 14, 2002 4:24 PM
To: php-db@lists.php.net
Subject: [PHP-DB] Zeropadding
Hi,
I use MySQL where I have a table. One of the fields is an INT(6), which I
zeropad. When I try to get the number to a variable it doesn't contain all
the numbers. If I give it a value of 59 I extract 59 and not 000059. Is
there a way I can get the hole number?
Regards,
Morten
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php