Ok,
The script is below.
<?php
include "config.php";
$link = mysql_connect($db_host, $db_user, $db_passwd);
mysql_select_db($mysql_db);
$query = 'SELECT * FROM bookings';
$result = mysql_query($query);
echo('<center><b>Details on upcoming tech events are below<b>');
echo "<table border='1'> <tr><td>ID</td><td>Booker Name</td> <td>Contact Name</td> <td>Event Name</td>
<td>Time</td>
<td>Block(s)</td> <td>Venue</td>
<td>Other General </td>
<td>Other Time </td>
<td>Packup</td>
<td>Setup</td>
<td>Other Sound Specs. </td>
<td>Other Sound </td>
<td>Foldback</td>
<td>Tape</td>
<td>PC</td>
<td>Projector</td>
<td>DVD Player </td>
<td>CD Player </td>
<td>Mic</td>
<td>W/l Mic </td>
<td>PA</td>
<td>House</td>
<td>Casual</td>
<td>Formal</td>
<td>Spot</td>
<td>Gels</td>
<td>Specify Gels </td>
<td>Event Description </td>
<td>Screen</td>
<td>Carpet</td>
<td>Curtains Open </td>
</tr>";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "\t<tr>\n";
foreach ($line as $col_value) {
echo "\t\t<td>$col_value</td>\n";
}
echo "\t</tr>\n";
}
echo "</table>\n";
echo ('</center>');
// Free resultset
mysql_free_result($result);
// Closing connection
mysql_close($link);
?>
and the booking is created by
<?php
include "config.php";
$varnames = array(
'booker',
'contact',
'event',
'date', // bogus entry, will be filled later
'block',
'where',
'oth_gen',
'other_time',
'packup',
'setup',
'oth_so_spec',
'other_sound',
'fbs',
'tape',
'pc',
'proj',
'dvdp',
'cdp',
'mic',
'wlm',
'pa',
'house',
'cas',
'form',
'spot',
'colo',
'colo_spec',
'oth_lig',
'oth_li_spec',
'des'
);
#
$_GET['date'] = mktime($_GET['h'], $_GET['m'], '0', $_GET['mo'], $_GET['d'], $_GET['y']);
foreach($varnames as $varname) {
$varvalues[] = isset($_GET[$varname])?$_GET[$varname]:'no';
}
#
$mysql = mysql_connect($db_host, $db_user, $db_passwd);
mysql_select_db($mysql_db, $mysql);
$query = "INSERT INTO bookings VALUES ('".implode("','",$varvalues)."')";
mysql_query($query, $mysql) or die(mysql_error());
mysql_close($mysql);
echo('The booking has been added. A technician will contact you soon.');
# ?>
As you can see when the booking is added the date is stored as a INT.
I want to using the script above make the date from a INT into a proper date without manually getting that field, etc
MTG