so i tried adding the $ sign, but the date is still not displaying. function startTable2($title) { $out = "<h3>$title</h3>" . "<table class=sample width=400>\n" ; return $out; } function getRecords2($sql) { $x = mysql_query($sql) or die(mysql_error()); $records = array(); if (mysql_num_rows($x) > 0) while ($z = mysql_fetch_array($x)) $records[] = $z; return $records; } function drawTable2($sql, $header) { // query $records = getRecords2($sql); $out = startTable2($header); // grab all the content and draw table foreach ($records as $record) { $cols = array('first', 'last', $sqldate); $out .= "<tr>\n" . "\t<td class=\"left\">$record[NAME]</td>\n"; foreach ($cols as $col) $out .= "<td>$record[$col]</td>\n"; $out .= "</tr>\n"; } $out .= "</table>\n"; return $out; } // change table and <h3> title for each team or add new teams here $tables = array( array("SELECT `first`, `last`, DATE_FORMAT($sqldate,'%d/%m/%Y') FROM `0607roster` WHERE `team` = 'CHA2'", "<strong>Chaudière 2</strong>"), array("SELECT `first`, `last`, DATE_FORMAT($sqldate,'%d/%m/%Y') FROM `0607roster` WHERE `team` = 'COR-M'", "<strong>Cortland</strong>"), array("SELECT `first`, `last`, DATE_FORMAT($sqldate,'%d/%m/%Y') FROM `0607roster` WHERE `team` = 'NE'", "<strong>New England</strong>"), array("SELECT `first`, `last`, DATE_FORMAT($sqldate,'%d/%m/%Y') FROM `0607roster` WHERE `team` = 'NJ'", "<strong>New Jersey</strong>"), array("SELECT `first`, `last`, DATE_FORMAT($sqldate,'%d/%m/%Y') FROM `0607roster` WHERE `team` = 'NY'", "<strong>New York</strong>"), array("SELECT `first`, `last`, DATE_FORMAT($sqldate,'%d/%m/%Y') FROM `0607roster` WHERE `team` = 'WP-M'", "<strong>West Point</strong>")); foreach ($tables as $x) { echo drawTable2($x[0], $x[1]); }