First you have to make the tables and the records, then make a database connection. something like
Code:
<?php
// This file contains the database access information. This file also establishes a connection to MySQL and selects the database.
// Set the database access information as constants.
define ('DB_USER', '');
define ('DB_PASSWORD', '');
define ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'yourdb');
// Make the connnection and then select the database.
$dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error() );
mysql_select_db (DB_NAME) OR die ('Could not select the database: ' . mysql_error() );
?>
and paste it to a php file, where you can just call it when you need it.
then you must have a form to get the inputs of the user, like month and day, right? after that redirect or pass the inputs to the same page or you can just past it to another page that contains the query.
first transfer these inputs on variables
Code:
$mnth = $_POST['month'];
$dy = $_POST['day'];
then you can use these variables in your query
Code:
$query = "SELECT * FROM '$mnth' WHERE day='$dy'";
$result = mysql_query ($query);
if (mysql_num_rows($result) == 0){
echo "<tr bgcolor=#FFFFFF><td colspan=5><font size=2 face=Verdana, Arial, Helvetica, sans-serif>There are no records</font></td></tr>";
}
else {
while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) {
?>
of course you have to close all the "{" with "}"
and do your way of presenting the records.
use this to get a column from a db <?php echo $row['day'];?>
Question, why do you have to make separate tables for the months? and have days there?
by the way, you need to study php first, ok?
Swirlee you want to comment on this? Did i solve the problem?