Re: Problem outputting MySQL Date field

From: Date: Sat, 29 Aug 2009 02:57:53 +0000
Subject: Re: Problem outputting MySQL Date field
References: 1 2 3  Groups: php.general php.windows 
Request: Send a blank email to php-windows+get-29563@lists.php.net to get a copy of this message
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

« previous php.windows (#29563) next »