I had a tiny syntax error keeping it from working in the form of a cap letter.
On 7/28/09 3:51 PM, "Miller, Terion" wrote:
On 7/28/09 3:48 PM, "Bastien Koert" wrote:
On Tue, Jul 28, 2009 at 4:02 PM, Miller,
Terion wrote:
> Ok so I got the
> $inDate = strtotime($results[3][$i]);
>
> Giving me the unix date now I am trying all the different date functions that
> will put it in the -00-00 like sql stores it because I ran it with the
> unix stamp and it just stored 00 in the db
>
> Hoping something like this works?
> $formatDate = date('ymd', $inDate);
>
>
> On 7/28/09 2:41 PM, "Miller, Terion" wrote:
>
> Well I was going along smoothly from this morningbut it came down to
> having to change the field type to date in the mySQL..so now I have this
> which returns a scraped value formatted like this 0/00/00 m/d/y
>
> $inDate = $results[3][$i];
>
> Which date function can I use to format for the db so that I will be able to
> use range references...there are so many get_date, date_modifyI'm
> lost...
>
> My full code is this:
>
> preg_match_all('/(.+)(.+).+(\d+\/\d+\/\d+)\s(.+)(.+).+Critical
> Violations Found:.+(\d+)(.+)Noncritical Violations Found:.+(\d+)/imsSU',
> utf8_encode($url), $results);
>
>
>
> for ($i=0; $i < count($results[0]); $i++)
> {
>$name1 = strtolower($results[1][$i]);
>
>$name =
> ltrim($name1);
>
>$address = strtolower($results[2][$i]);
>
>$inDate
> = $results[3][$i];
>
>$inType = $results[4][$i];
>
>$notes =
> trim($results[5][$i]);
>
>$critical = trim($results[6][$i]);
>
>
> echo "$noncritical ";
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Can't you just explode the string and put it back together in the
/MM/DD format that you need?
--
Bastien
Cat, the other other white meat
Well I got it all formatted and going in the db right and now I'm able to use
the BETWEEN in my sql and it works like a charm but when I echo the date for
the page I need to put it back in mm/dd/ order and that part is giving me
problems...
Not getting why since I figured I could do this again:
$date = $row['inDate'];$formatDate = date('mdy', $Date);
But at any rate it's nearly beer o'clock here hooray, and I'm feeling like
today I have earned one or two!!
Until tomorrow
Terion
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php