MySQLtest

This page is to test the MySQL database display.
The database I set up is called march. It is on the medivoiceover.com site, on the mysql server there. You can see the database and the tables by going to mysql.medivoiceover.com and using
username:sanwootester
password:allwood1

You can also download the client Sequel Pro to see and work on the database.

This code tests the php function within WordPress, which works because I installed a plugin called Exec-PHP and followed their instructions to modify my profile to turn off the Visual Editor so it won’t muck with the code.
——————————————————————————————————

——————————————————————————————————

This next bit of code connects to the database, and if it connects, it says Connected to MySQL:
——————————————————————————————————-
“;
?>
——————————————————————————————————
This next bit of code calls the table SpringWardWeekday. I originally called it Spring Ward’s Weekday, but both the spaces and the apostrophes make the SQL code more difficult and prone to error, so I change the table names to eliminate both spaces and apostrophes. So far I have not added titles to the columns, such as Departs City, Departs Ward’s and Direct Boat
————————————————————————————————————————-

\n”;
while($row = mysql_fetch_row($result)) {
print “

\n”;
foreach($row as $field) {
print “

$field

\n”;
}
print “

\n”;
}
print “

\n”;
mysql_close($link);

?>
——————————————————————————————————-
——————————————————————————————————-

One more table, this calls the SpringWardWeekend schedule up, this has 4 columns: these won’t line up, not integrated in the code, since the tables are going to be called by buttons anyway:

From City From Ward’s Direct Boat Y/N Saturday and Holidays only Y/N

“;
?>

\n”;
while($row = mysql_fetch_row($result)) {
print “

\n”;
foreach($row as $field) {
print “

$field

\n”;
}
print “

\n”;
}
print “

\n”;
mysql_close($link);

?>

——————————————————————————————————-
——————————————————————————————————-

This calls the Season table: this is what we should be able to modify on an ongoing basis, to change the dates when the ferry schedule changes: already we can do this in Sequel Pro and the web access mysql.medivoiceover.com, but it would be nice to build this up to one level higher, so it is a modifiable web page control panel

The column headings are

Name , Starts On , Weekend Days , Extra Boats

I’m not sure we need the Extra Boats column, just trying to figure out the best way to deal with those extra morning boats to and from Ward’s in the spring, summer and fall, on Saturdays and Holidays only. Probably the way I’ve done it above, in the Spring Ward’s Weekend schedule, is the way we should also do it in Summer Ward’s Weekend and Fall Ward’s Weekend

\n”;
while($row = mysql_fetch_row($result)) {
print “

\n”;
foreach($row as $field) {
print “

$field

\n”;
}
print “

\n”;
}
print “

\n”;
mysql_close($link);

?>

Note: these are just mockup Starts On dates, I don’t have the real ones.