Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MYSQL]Pola w bazie MySQL
--Cr3dO--
post 13.11.2008, 11:05:36
Post #1





Goście







Hej

Czy da sie usatwic w bazie danych aby pole zawieralo wartosci : 001, 001, 003 itd.
a nie jak mam w INT : 1, 2, 3 itd.
?
pozdrawiam
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
nospor
post 13.11.2008, 11:09:02
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




zerofill?
http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html
Cytat
When used in conjunction with the optional extension attribute ZEROFILL, the default padding of spaces is replaced with zeros. For example, for a column declared as INT(5) ZEROFILL, a value of 4 is retrieved as 00004.


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
mike
post 13.11.2008, 11:09:15
Post #3





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

Ostrzeżenie: (0%)
-----


Jeśli chcesz koniecznie t przechowuj ciągi znaków. Masz od tego pola o typach tekstowych.
Jeśli chcesz liczby i koniecznie o takim formacie to ... po co? Ale jeśli to zerofill ;-)
Go to the top of the page
+Quote Post
--Cr3dO--
post 13.11.2008, 11:17:15
Post #4





Goście







Dzieki, mam juz co chcialem uzyskac smile.gif
pozdrawiam, EOT
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 03:17