PHP Experience

adelphia hawkwynd at adelphia.net
Wed Oct 27 23:13:28 EDT 2004


I found the solution - thanks to all who replied to me and were so patient
with my constant questions..


Oh, one more thing.. How do I use php to grep a string to test for numbers
at the beginning of the string.
$String = "1232 Abbiton Street"

Just need to know how many numbers are contained in a string..
(preg_match ("[d(2)]", $Event_Address) <= I know this is wrong..

grep?

Thanks again!


----- Original Message ----- 
From: "adelphia" <hawkwynd at adelphia.net>
To: <nflug at nflug.org>
Sent: Wednesday, October 27, 2004 8:24 PM
Subject: Re: PHP Experience


Hi Tim,

    I'm working on my first mySql project. I have a web form, for inserting
a date field into mySql.
The field in the table is set to timestamp in mySql.

I prepare the data for insert with:

    list($month, $day, $year) = split('[/.-]', $_POST['Event_Date_Start']);
    $Event_Date_Start = $year."-".$month."-".$day;

And it is stored in mySql as "20041027164404"

I query the records, and recall the Event_Date_Start record to display on
the page:

    $num=mysql_numrows($result);
    $i=0;
    while ($i < $num) {
         $Event_Date_Start=mysql_result($result,$i,"Event_Date_Start");
         echo date("l, F j, Y",$Event_Date_Start)." at ".$Event_Time_Start;
    }

Now, here's the result:
        Monday, January 18, 2038


    It's an incorrect date.It should be Saturday, November 27, 2004. I'm
stumped, after perusing through pages and pages of PHP manuals, there's
little reference to fix this with mySql and php.. Any help with this would
be appreciated...

    PS: it's not any better using  date("l, F j,
Y",strtotime($Event_Date_Start));

Any thoughts?

Scott




----- Original Message ----- 
From: "Timothy J. Finucane" <speljamr at speljamr.com>
To: <nflug at nflug.org>
Sent: Wednesday, October 27, 2004 7:52 PM
Subject: Re: PHP Experience


I have a good amount of experience with PHP/MySQL. What kind of
assistance do you require?

Tim




More information about the nflug mailing list