Ok I am new to mySQL and am trying to make a diary. I have worked out most of it but I am stuck on making the date DDMMYYYY instead of YYYYMMDD (in the output). I know I am supposed to use date_function but I do not see where exactly to insert it into my output. I tried several things and it didnt work. This is my code (which I got help on from a nice person at BW :]):
<?php
functions if you wanted to)
$dbAddress = \'localhost\';
$dbUsername = \'diss\';
$dbPassword = \'************\';
$dbName = \'diss\';
($dbAddress,$dbUsername,$dbPassword) or die (\"Critical Error 001: Unable to connect to MySQL host\");
mysql_select_db($dbName,$dbConnection) or die (\"Critical Error 002: Unable to connect to the database\");
$myQuery = mysql_query(\"SELECT * FROM ldiary ORDER BY date\",$dbConnection);
$myResults = mysql_fetch_array($myQuery);
//HEADERS
printf(\'<table border=\"0\" cellpadding=\"3\" width=\"720\" cellspacing=\"1\" bgcolor=\"#000000\">\');
printf(\'<tr>\');
printf(\' <td width=\"100\" td bgcolor=\"#AOAOCD\" align=\"center\"><font face=\"Arial\" color=\"#FFFFFF\" size=\"2\"><b>Date</b></font></th>\');
printf(\' <td width=\"100\" td bgcolor=\"#AOAOCD\" align=\"center\"><font face=\"Arial\" color=\"#FFFFFF\" size=\"2\"><b>Time</b></font></th>\');
printf(\' <td width=\"260\" td bgcolor=\"#AOAOCD\" align=\"center\"><font face=\"Arial\" color=\"#FFFFFF\" size=\"2\"><b>Event Information</b></font></th>\');
printf(\' <td width=\"260\" td bgcolor=\"#AOAOCD\" align=\"center\"><font face=\"Arial\" color=\"#FFFFFF\" size=\"2\"><b>Server</b></font></th>\');
printf(\'</tr>\');
//INSERTING DATE
do {
printf(\'<tr>\');
printf(\' <td bgcolor=\"#FFFFFF\" align=\"center\"><font face=\"Arial\" size=\"2\" color=\"#000000\">%s</td>\', $myResults[\"date\"]);
printf(\' <td bgcolor=\"#FFFFFF\" align=\"center\"><font face=\"Arial\" size=\"2\" color=\"#000000\">%s</td>\', $myResults[\"time\"]);
printf(\' <td bgcolor=\"#FFFFFF\" align=\"center\"><font face=\"Arial\" size=\"2\" color=\"#000000\">%s</td>\', $myResults[\"event\"]);
printf(\' <td bgcolor=\"#FFFFFF\" align=\"center\"><font face=\"Arial\" size=\"2\" color=\"#000000\">%s</td>\', $myResults[\"server\"]);
printf(\'</tr>\');
} while ($myResults = mysql_fetch_array($myQuery));
echo \"</table>\";
?>