Hello,
I have a Mysql database containing 17 date fields. I can display them in my php page just fine when I reference them with:
print "<td width='90'>$row[14]</td>";
However they print as 2002-09-06, I would like to print as 09-06-2002.
I have seen plenty of methods of formatting dates from the database, but can't figure out how to format these fields when I call them as $row[14].
( $row[14] is just one of the date fields. )
a little point in the right direction needed.
some of my code:
$query .= " SELECT * FROM customer_tbl, projects_tbl, products_tbl
WHERE projects_tbl.pid='$project_select' # find the correct project from passed variable.
AND products_tbl.projid='$project_select' # display only the correct project.
AND projects_tbl.custid=customer_tbl.cid"; # display only the correct customer.
$result=mysql_query($query);
$num_rows = mysql_num_rows( $result );
while($row=mysql_fetch_row($result))
{
// Date fields
print "<tr align='center' valign='top'>";
print "<td width='90'>$row[12]</td>";
print "<td width='90'>$row[14]</td>";
print "<td width='90'>$row[15]</td>";
print "<td width='90'>$row[17]</td>";
}
Thanks!
Frank Maestas
fmaestas@ttseagle.com