Re: [PHP] Problem outputting MySQL Date field

Jim Lucas <[email protected]>
Newsgroups gmane.comp.php.windows,gmane.comp.php.general
Message-ID <[email protected]>
John Meyer wrote:
> Devendra Jadhav wrote:
>> No need to do anything special. It should display date as string. Can 
>> you provide little more information or code snippet?
> $tweettable .= 
> preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', 
> '<a href="$1">$1</a>',$row["TWEET_TEXT"]) . "<br>" . "Sent at: " . 
> $rowqry["TWEET_CREATEDAT"];
>        $tweettable .= "<br>Sent Using: " . $row["TWEET_CREATEDBY"] . 
> "</td></tr>";
> 
> And I checked the database.  The date is there.
> 

Two things jump out.

1.  TWEET_CREATEDAT  is that suppose to be TWEET_CREATEDATE  ??
2. two variables are accessed from the $row array, but the third is referenced from the $rowqry 
array.  This begs the question: Which is it?  $row or $rowqry ?

Try this

$tweettable .= preg_replace(
	'@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@',
	'<a href="$1">$1</a>',
	$row["TWEET_TEXT"]);
$tweettable .= '<br />Sent at: ' . $row["TWEET_CREATEDATE"];
$tweettable .= '<br />Sent Using: {$row['TWEET_CREATEDBY']}</td></tr>";

-- 
Jim Lucas

    "Some men are born to greatness, some achieve greatness,
        and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
     by William Shakespeare

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.