I'm creating a simple updateable website for a band. There is a section where they can update their show information. Basically just a form that populates a db with all the info. There is a show_date field, so any show that is before the current date gets taken off the website automatically. A few questions:
What is the best way to capture the date and time in the html form? Should it be a text field? Also, I suppose I would need to validate it somehow, something I'm not too familiar with. Is PHP the best to use for this, or something else like javascript?
Next, I'm trying to figure out what the statement would be in the php code. Basically I'm not sure of what the syntax would be. My current code will show all records in the db:
<?php
$link = mysql_connect("xxxxxxxxxxx",xxxxxxxx","xxxxxxxxxxx")
or die(mysql_error());
mysql_select_db("xxxxxxxxxx")
or die (mysql_error());
$query = "SELECT * " .
"FROM shows";
$result = mysql_query($query, $link)
or die(mysql_error());
$num_movies = mysql_num_rows($result);
$show_details = '';
while ($row = mysql_fetch_array($result)) {
$show_date = $row['show_date'];
$show_venue = $row['show_venue'];
$venue_url = $row['venue_url'];
$venue_address = $row['venue_address'];
$venue_phone = $row['venue_phone'];
$venue_maplink = $row['venue_maplink'];
$show_details .=<<<EOD
<h3>$show_date</h3>
<p><a href="$venue_url">$show_venue</a><br />
$venue_address <a href="$venue_maplink">Map it</a><br />
$venue_phone</p>
EOD;
}
echo $show_details;
?>