Go Back   Dreamweaver Club Forums > Dreamweaver forums > Video Tutorials
Register FAQ Members List Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Old 05-04-2007, 12:00 PM   #1
Join Date: May 2007
Posts: 1
Default Formating dates


Thanks for the tutorials - found them to be a great starting place for a complete newbie. Following the code from the beginners PHP tutorial but I'm stuck trying to format my dates. I follow the tutorial syntax almost exactly and I'm trying to format the date. My code is:

$query = sprintf("SELECT * FROM bookings ORDER BY bl_datefor, bl_reference");
$result = mysql_query($query);
$row = mysql_fetch_assoc($result);

do {
echo "<tr>";
/////////////////////////////////my attempt to format a date
echo "<td>".date("d-m-y", $row['bl_datefor'])."</td>";
echo "<td>".$row['bl_reference']."</td>";
echo "<td>".$row['bl_supplier']."</td>";
echo "<td>".$row['bl_givento']."</td>";
echo "<td>".$row['bl_takenby']."</td>";
echo "<td>".$row['bl_dategiven']."</td>";
echo "<td>".$row['bl_pieces']."</td>";
echo "<td>".$row['bl_orders']."</td>";
echo "</tr>";
} while ($row = mysql_fetch_array($result))

When I try to format the date they all come out at 01-01-70. Anyone know an easy (perhaps global) way to fix this?
dandy is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 12:20 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com