[snip] > In a receipt to the customer you might want to show them their date of > order and other information using: > > $query="SELECT DATE_FORMAT(o.date, '%m/%d/%Y'), > it.cost > FROM order o, item it > WHERE cust_id = $custId"; > > To display this: > $date=$row["DATE_FORMAT(o.date, '%m/%d/%Y')"]; > > echo $date;
As an alternative, you can use a query such as this: $query = "SELECT DATE_FORMAT(o.date, '%m/%d/%Y') as alias, ... and then print the value with $date = $row['alias']; echo $date; instead of using row["DATE_FORMAT(o.date, '%m/%d/%Y')"]; It makes things easier to read in your code, too... ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php