[FLUG] Re: query mysql

Mailing List del Fortunae LUG
=============================

> SELECT MONTH(data) FROM burogu ORDER BY MONTH(data) DESC
>
> tiro fuori tutti i mesi che ci sono dentro, ora il mio problema e` che
> se il mese e` 07 lui mi tira fuori solo 7, e` possibile fargli tirare
> fuori direttamente 07?

No però se $str è il "7" che hai tirato fuori puoi fare tipo:

if(strlen($str) == 1)
{
  $str = '0' . $str;
}

Ma c'era una funzione che faceva da sola il padding... wuh se la ricorda di
sicuro.

--
Simon.


-- 
«Just in terms of allocation of time resources, religion is not very efficient. 
There's a lot more I could be doing on a Sunday morning.» Bill Gates

Other related posts: