Okay, I have a page where I am querying the results of a schedule table.
table "schedule" looks like this:
id | date | time | location | home | visitor | league | referee | ar1 | ar2
When it queries the schedule table, it displays the data in a table format on the webpage, however, the "referee", "ar1", and "ar2" columns are empty for each entry. This is because when the games are entered into the schedule, the referees for each game are not.
How do I set it up so that I can enter referee's names into those 3 columns on this query page, and have them saved into the proper place in the table? Ex: If I added referee's to a game on 04-25-2005, when I pressed the submit button, it would update the record in the schedule table corresponding to that game.
Below is the code for the query page if it will help. I don't know the code to make this work, and I don't know where to put it in the code. Any help is very very much appreciated!
<?
$db_name ="refphoto_dbname";
$table_name ="schedule";
$connection = @mysql_connect("localhost","refphoto_dbname","dbpw") or die(mysql_error());
$db = @mysql_select_db($db_name,$connection) or die(mysql_error());
$sql = "SELECT id, date, time, trim(concat(date, ' ' ,time)) as datetime, location, home, visitor, league, referee, ar1, ar2 FROM $table_name ORDER BY datetime";
$result = @mysql_query($sql,$connection) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$id = $row['id'];
$datetime = $row['datetime'];
$date = $row['date'];
$time = $row['time'];
$location = $row['location'];
$home = $row['home'];
$visitor = $row['visitor'];
$league = $row['league'];
$referee = $row['referees'];
$ar1 = $row['ar1'];
$ar2 = $row['ar2'];
if ($date_acq == "0000-00-00") {
$date_acq ="[unknown]";
}
$display_block .= "
<table cellspacing=0 cellpadding=1 border=1 bordercolor=000000>
<tr>
<td valign=top width=85>
$date
</td>
<td valign=top width=75>
$time
</td>
<td valign=top width=150>
$location
</td>
<td valign=top width=150>
$home
</td>
<td valign=top width=150>
$visitor
</td>
<td valign=top width=150>
$league
</td>
<td valign=top width=150>
$referee
</td>
<td valign=top width=150>
$ar1
</td>
<td valign=top width=150>
$ar2
</td>
</tr>
</TABLE>
";
}
?>
<HTML>
<HEAD>
<TITLE>ECISOA Game Assignments</TITLE>
</HEAD>
<BODY>
<H1><font color="#CC0000" face="Verdana, Arial, Helvetica, sans-serif">ECISOA Game Assignments</font></H1>
<table border=1 cellpadding=1 cellspacing=0 bordercolor=000000 bgcolor="#CC0000">
<tr>
<td valign=top width=85> <font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Date:</strong>
</font></td>
<td valign=top width=75> <font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Time:
</strong> </font></td>
<td valign=top width=150> <font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Location:</strong>
</font></td>
<td valign=top width=150> <font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Home:</strong>
</font></td>
<td valign=top width=150> <font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Visitor:</strong></font></td>
<td valign=top width=150> <font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>League:</strong>
</font></td>
<td valign=top width=150> <font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Referee:</strong></font></td>
<td valign=top width=150> <font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>AR1:</strong>
</font></td>
<td valign=top width=150> <font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>AR2:</strong>
</font></td>
</tr>
</TABLE>
<? echo "$display_block"; ?>
<P><a href="referee_menu.php"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Return
to Menu</font></a></P>
</BODY>
</HTML>