Ask a Question related to PHP Development, Design and Development.
-
Peter Akrill #1
Always making Ints 2 chars long
Hello all,
I'm trying to create a menu bar option of posts in the past 5 months. I do
this by getting the month from date('m'), and then subtracting 1 from it
each time, However the problem is that whenever I subtract 1 it goes to
single figures, which ruins the sql query. Is there anyway to convert the
value from 6 to 06..etc?
Regards
Peter Akrill
--
/********************************************
No Electrons were harmed during
making of this message
[url]http://darkflame.sinisterkitten.co.uk[/url]
*********************************************/
Peter Akrill Guest
-
Question about a long session timeout (somewhat long)
I've been told by my developers to increase the asp.net session timeout to 72 hours. Being a server guy, it concerns me because of the obvious... -
#39916 [NEW]: Auto trunkation of floats to ints in array indices should raise a warning
From: thuejk at gmail dot com Operating system: All PHP version: 5.2.0 PHP Bug Type: Feature/Change Request Bug description:... -
String Literal Too Long - (less than 4000 chars)
We have a form field where users enter in a status (free text, any characters, etc). Not in every case, but a good portion of the time, when a user... -
ORA 01704:...too long; Only inserting 800 chars
Hi, I am trying to insert text into a VARCHAR2 (4000) database field in Oracle 8.1.7. We are using CF Server Version 5. The text that is being... -
receiving ??? chars instead of "special" chars
Hello i have a strange problem i made a online catalogue and must submit orders to a remote server I need to connect to a remote webservice on ... -
steve #2
Re: Always making Ints 2 chars long
"Peter Akrill" wrote:
goes> Hello all,
>
> I’m trying to create a menu bar option of posts in the past 5
> months. I do
> this by getting the month from date(’m’), and then
> subtracting 1 from it
> each time, However the problem is that whenever I subtract 1 itconvert> to
> single figures, which ruins the sql query. Is there anyway toWhat is the query you are trying to execute?> the
> value from 6 to 06..etc?
>
> Regards
> Peter Akrill
--
[url]http://www.dbForumz.com/[/url] This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: [url]http://www.dbForumz.com/PHP-making-Ints-chars-long-ftopict146492.html[/url]
Visit Topic URL to contact author (reg. req'd). Report abuse: [url]http://www.dbForumz.com/eform.php?p=490477[/url]
steve Guest
-
Mr. Foo #3
Re: Always making Ints 2 chars long
if( $month < 10 ){
$month = "0" . $month;
}
or you can check the length using substr and if the length
is less than 2 add leading 0
"steve" <UseLinkToEmail@dbForumz.com> wrote in message
news:413a0032$1_5@alt.athenanews.com...> "Peter Akrill" wrote:> goes> > Hello all,
> >
> > I'm trying to create a menu bar option of posts in the past 5
> > months. I do
> > this by getting the month from date('m'), and then
> > subtracting 1 from it
> > each time, However the problem is that whenever I subtract 1 it> convert> > to
> > single figures, which ruins the sql query. Is there anyway to>> > the
> > value from 6 to 06..etc?
> >
> > Regards
> > Peter Akrill
> What is the query you are trying to execute?
>
> --
> [url]http://www.dbForumz.com/[/url] This article was posted by author's request
> Articles individually checked for conformance to usenet standards
> Topic URL:
> [url]http://www.dbForumz.com/PHP-making-Ints-chars-long-ftopict146492.html[/url]
> Visit Topic URL to contact author (reg. req'd). Report abuse:
> [url]http://www.dbForumz.com/eform.php?p=490477[/url]
Mr. Foo Guest
-
Janwillem Borleffs #4
Re: Always making Ints 2 chars long
Mr. Foo wrote:
Or just do (s)printf("%02d", $month);> if( $month < 10 ){
> $month = "0" . $month;
> }
>
> or you can check the length using substr and if the length
> is less than 2 add leading 0
>
JW
Janwillem Borleffs Guest



Reply With Quote

