Date Formatting Question

Date Formatting Question

am 14.12.2005 15:13:24 von mbomgardner

I am trying to format the month portion of a date that I am trying to
pull from MySQL to be placed into a drop down menu to modify the date.
I have tried several ways and none seem to be working. =20

I am pulling the date out of MySQL with:=20
$sDate =3D explode("-", $row_events['Sdate']);

And then attempting to insert each portion of the array into a drop down
menu with:
echo "";
> echo "";
> which is where I am running into the problem. I pull out the month as 2
> digit numeric 01, 02, 03 etc., but I want it displayed as January,
> February, March, etc.,
>
> I have tried the following with no success:
> Date("F",strtotime($sDate));
> Strftime("%B:,$sDate);
> Date("F",$sDate);
>
>
> I would use MySQL to format the date, but I have three date fields to
> modify and it would be easier to do it in PHP
>
> Any pointers would be appreciated.
>
>
> Mark Bomgardner
> Technology Specialist
> KLETC

make a function like this:

function datenum2str($date)
{
$newdate = str_replace("01","Jan",$date);
$newdate = str_replace("02","Feb",$date);
$newdate = str_replace("03","Mar",$date);
$newdate = str_replace("04","Apr",$date);
$newdate = str_replace("05","May",$date);
$newdate = str_replace("06","Jun",$date);
$newdate = str_replace("07","Jul",$date);
$newdate = str_replace("08","Aug",$date);
$newdate = str_replace("09","Sep",$date);
$newdate = str_replace("10","Oct",$date);
$newdate = str_replace("11","Nov",$date);
$newdate = str_replace("12","Dec",$date);

return $newdate;
}

And then use this:

echo "\n";
for ($i = 1; $i <= 12; $i++)

// using date() below to get month name, day and year irrelevant
$selectMonthText = date("F", mktime(0, 0, 0, $i, 1, 2000));

if ($i == $monthNumber)
$selected = " SELECTED";
else
$selected = "";

echo "\n";

echo "\n";


-TG


= = = Original message = = =

I am trying to format the month portion of a date that I am trying to
pull from MySQL to be placed into a drop down menu to modify the date.
I have tried several ways and none seem to be working.

I am pulling the date out of MySQL with:
$sDate = explode("-", $row_events['Sdate']);

And then attempting to insert each portion of the array into a drop down
menu with:
echo "";
>echo "";
>
>
>Hope it helps,
>
>El Bekko



========================================================
CaptionKit http://www.captionkit.com : Production tools
for accessible subtitled internet media, transcripts
and searchable video. Supports Real Player, Quicktime
and Windows Media Player.

VideoChat with friends online, get Freshly Toasted every
day at http://www.fresh-toast.net : NetMeeting solutions
for a connected world.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

range_alloc_block_size

am 16.12.2005 10:32:28 von Murat Beyhan

Hello,

Im using PHP and MySQL
I try to import txt file to mysql Database
But file size bigger than 2048KB so I could not import it
It is related with range_alloc_block_size
Because in mysql this veriable is 2048.
If it is possible how can I change this variable.
Please If somebody knows this help me..
Thank you...
Murat


______________________________________
XamimeLT - installed on mailserver for domain @deprem.gov.tr
Queries to: postmaster@deprem.gov.tr
______________________________________
The views and opinions expressed in this e-mail message are the sender's own
and do not necessarily represent the views and the opinions of Earthquake Research Dept.
of General Directorate of Disaster Affairs.

Bu e-postadaki fikir ve gorusler gonderenin sahsina ait olup, yasal olarak T.C.
B.I.B. Afet Isleri Gn.Mud. Deprem Arastirma Dairesi'ni baglayici nitelikte degildir.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: range_alloc_block_size

am 16.12.2005 11:24:17 von Aaron Koning

------=_Part_6227_21763044.1134728657030
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

This could be a number of things. Are you uploading the file in the script?
Then the max_upload_size may have been exceeded. If not, then it could be
the memory_limit, or the max_execution_time. Check your httpd/php error log
(commonly at: /var/log/httpd/error_log) and adjust the referenced variables
in the PHP ini value or using ini_set().

Read this post also:
http://aspn.activestate.com/ASPN/Mail/Message/php-db/2931073

I can't imagine this is a DB problem.

Aaron



On 12/16/05, Murat Beyhan wrote:
>
> Hello,
>
> Im using PHP and MySQL
> I try to import txt file to mysql Database
> But file size bigger than 2048KB so I could not import it
> It is related with range_alloc_block_size
> Because in mysql this veriable is 2048.
> If it is possible how can I change this variable.
> Please If somebody knows this help me..
> Thank you...
> Murat
>
>
> ______________________________________
> XamimeLT - installed on mailserver for domain @deprem.gov.tr
> Queries to: postmaster@deprem.gov.tr
> ______________________________________
> The views and opinions expressed in this e-mail message are the sender's
> own
> and do not necessarily represent the views and the opinions of Earthquake
> Research Dept.
> of General Directorate of Disaster Affairs.
>
> Bu e-postadaki fikir ve gorusler gonderenin sahsina ait olup, yasal olara=
k
> T.C.
> B.I.B. Afet Isleri Gn.Mud. Deprem Arastirma Dairesi'ni baglayici nitelikt=
e
> degildir.
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

------=_Part_6227_21763044.1134728657030--

Re: range_alloc_block_size

am 16.12.2005 11:38:31 von robleyd

> On 12/16/05, Murat Beyhan wrote:
>>
>> Hello,
>>
>> Im using PHP and MySQL
>> I try to import txt file to mysql Database
>> But file size bigger than 2048KB so I could not import it
>> It is related with range_alloc_block_size
>> Because in mysql this veriable is 2048.
>> If it is possible how can I change this variable.
>> Please If somebody knows this help me..
>> Thank you...
>> Murat

Aaron Koning wrote:

> This could be a number of things. Are you uploading the file in the
> script? Then the max_upload_size may have been exceeded. If not, then it
> could be the memory_limit, or the max_execution_time. Check your httpd/php
> error log (commonly at: /var/log/httpd/error_log) and adjust the
> referenced variables in the PHP ini value or using ini_set().
>
> Read this post also:
> http://aspn.activestate.com/ASPN/Mail/Message/php-db/2931073
>
> I can't imagine this is a DB problem.
>
> Aaron

It might well be. There is a config setting in mysql called
max_allowed_packet which might be relevant in this case. IIRC it defaults
to quite a small value. Yes, the default is 1 Mb in versions 3 and 4 of
mysql.



Cheers
--
David Robley

"I joined the Lion's Club," said Tom pridefully.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php