I'm a bit unsure what exactly you want to do ... but for starters, the values of your <input> fields will be blank - you need to get the info from the db into the various variables. You'll need to run a query, fetch them into an array, and then bust em out ... I've changed the database connection a bit so it's easier to do the above.
if (!$dbh=mysql_connect ("localhost", "blackwha_dynamo", "dynamo"))
print "<p>I couldn't connect to the database. MySQL said:<br />" . mysql_error() . '</p>';
else {
mysql_select_db ("blackwha_dynamo");
//compose query:
$query = 'SELECT monday, tuesday, wednesday, thursday, friday, saturday, sunday FROM weekdays';
//run your query, give error message if something went wrong:
if (!$resultHandle = mysql_query($query))
print "<p>I couldn't complete the query. MySQL said:<br />" . mysql_error() . '</p>';
else {
//get data one row at a time into an associative array called $row
while ($row = mysql_fetch_assoc($resultHandle)) {
//get data out of $row and into variables named after the keys (column names/days of the week)
extract($row);
//now print your HTML as in your example
}
}
}
This assumes you have many rows of data in columns named after the days of the week in a table called weekdays.
Be sure to wrap the appropriate sections in <form> tags, and include any necessary hidden <input>s, and a submit button.
Not sure if that's what you're looking for ...