PDA

View Full Version : small request


Sebastian
11-19-2002, 12:59 AM
I am trying to get this to get the date a thread was started in this format: Monday, November 18, 2002, How do I get it in that format?

Thanks.



$connection = mysql_connect("$servername","$dbusername","$dbpassword") or die ("Cannot connect to server.");

//select database
$db = mysql_select_db("$dbname", $connection) or die ("Could not select database.");

// create sql statement
$sql = "SELECT threadid, title, forumid, replycount, postusername, postuserid, lastposter, dateline, iconid FROM thread WHERE forumid = \"$newsforums\" ORDER BY threadid DESC LIMIT $newsitems";
//execute sql query
$sql_result = mysql_query($sql, $connection) or die ("Could not execute query.");

if (!$sql_result) {
echo "<p>Could not get record.";
}


while ($row = mysql_fetch_array($sql_result)) {
$threadid = $row["threadid"];
$thetitle = $row["title"];
$forumid = $row["forumid"];
$postusername = $row["postusername"];
$postuserid = $row["postuserid"];
$iconid = $row["iconid"];


echo "<font face=\"Verdana\" size=\"2\"><a href=\"$forumspath/showthread.php?s=&threadid=$threadid\">$thetitle</a> by <a href=\"$forumspath/member.php?s=&action=getinfo&userid=$postuserid\">$postusername</a></font><br>";

}

mysql_free_result($sql_result);
mysql_close($connection);

Logician
11-19-2002, 07:45 AM
$mydate=date("l, F d, Y",$row['dateline']);

Sebastian
11-19-2002, 11:47 AM
Thanks dude.