Hi,

I upgraded my PHP script from using a flat file to MYSQL.
The web page generated by the php script includes
a checkbox that toggles whether or not certain lines
of data are displayed or not.

It works fine when I use a flat file as my data source,
but when I switched to MySQL, the checkbox only works
ONCE. After the first click, nothing happens -- the page
does not get re-loaded.

Any ideas???

The relevant code sections for both versions follow.

Thanks,

Paul
----------------------
*** flat file version ***
<?...... etc. ....

$f = file( 'apps/list' );
while ( list( $line_num, $line ) = each($f) ) {
list($name, $resp, $livedate, $enddate, $state) = split(":", chop($line));
$dead = !strcmp($state, "dead");
if ($dead) {
if (!$show) { continue; }
$color = "lightblue";
} else {
$color = "white";
}
echo "<TR ALIGN='center' BGCOLOR=$color>"; echo "<TD>"; echo $row["name"]; echo "</TD>"; echo
"<TD>$resp</TD>";
if ($dead) {
echo "<TD><A HREF='notReady.html' TARGET='_blank'>Click here to re-activate</A></TD>"; echo
"<TD>$enddate</TD>"; } else {
echo "<TD>$livedate</TD>"; echo "<TD><A HREF='shutApp.php?app=$name'
TARGET='_blank'>$enddate</TD>";
}
echo
"</TR>"; } $show = ! $show;
$text = $show ? "Show" : "Hide";
echo "</TABLE>";
echo "<FORM><INPUT TYPE=checkbox name=show value=$show onClick="submit()">$text <FONT
COLOR="steelblue">terminated</FONT> applications"</FORM>;
?>

*** MySQL version ***
<?
$result = mysql_db_query ("appsdb", "SELECT * FROM apps"); while($row = mysql_fetch_array($result)) {
$dead = !strcmp($row["status"],
"d"); if ($dead) { if (!$show) { continue; }
} else {
$color = "white";

}
echo "<TR ALIGN='center' BGCOLOR='$color'>";
echo "<TD>"; echo $row["name"]; echo "</TD>"; echo "<TD>"; echo $row["responsible"]; echo "</TD>";
if ($dead) { echo "<TD><A HREF='notReady.html' TARGET='_blank'>Click here to re-activate</A></TD>";
echo "<TD>"; echo $row["end_date"]; echo "</TD>";
} else
{
echo "<TD>"; echo $row["live_date"]; echo "</TD>"; echo "<TD><A HREF='shutApp.php?app='"; echo $row["name"]
;
echo "'>"; echo $row["end_date"]; echo "</TD>";

}
echo "</TR>";
}
mysql_free_result($result);
$show = ! $show;
$text = $show ? "Show" :
"Hide"; echo "</TABLE>"; echo "<FORM><INPUT TYPE=checkbox name=show value=$show
onClick="submit()">$text <FONT COLOR="steelblue">terminated</FONT> applications"</FORM>;
?>