Maybe this problem is not due to the code?
The reason I suggest this possibility is that I have reduced the problem to the following 2 sets of code....one which works and one which doesnt work.
The problem is that I cant see any difference between the 2.
If I copy "workingcode.php" into my program the program works
If I copy "non-workingcode.php" into my program the program wont work but doesnt throw any errors either....seems invisible!!!
workingcode.php
<?php
session_start();
// open the connection
$conn = mysql_connect("h41mysql45.secureserver.net", "ezevetdistanceed", "password");
// pick the database to use
mysql_select_db("ezevetdistanceed",$conn);
// create the SQL statement
$sql = "SELECT * FROM studentanswers WHERE studentid = '$studentid' and quiznum = $_POST[quiznumber]";
// execute the SQL statement
$result = mysql_query($sql, $conn) or die(mysql_error());
/* Display results in a table */
echo "<table cellspacing='15'>";
echo "<tr><td colspan='4'><hr></td></tr>";
while ($row = mysql_fetch_array($result))
{
extract($row);
echo "<tr>\n
<td>$quiznum</td>\n
<td>$datetime </td>\n
<td>$passfail</td>\n
<td>$num_wrong</td>\n
</tr>\n";
echo "<tr><td colspan='4'><hr></td></tr>\n";
}
echo "</table>\n";
?>
and the non-workingcode.php
<?php
session_start();
// open the connection
$conn = mysql_connect("h41mysql45.secureserver.net", "ezevetdistanceed", "password");
// pick the database to use
mysql_select_db("ezevetdistanceed",$conn);
// create the SQL statement
$sql = "SELECT * FROM studentanswers WHERE studentid = '$studentid' and quiznum = $_POST[quiznumber]";
// execute the SQL statement
$result = mysql_query($sql, $conn) or die(mysql_error());
/* Display results in a table */
echo "<table cellspacing='15'>";
echo "<tr><td colspan='4'><hr></td></tr>";
while ($row = mysql_fetch_array($result))
{
extract($row);
echo "<tr>\n
<td>$quiznum</td>\n
<td>$datetime </td>\n
<td>$passfail</td>\n
<td>$num_wrong</td>\n
</tr>\n";
echo "<tr><td colspan='4'><hr></td></tr>\n";
}
echo "</table>\n";
?>
Now as far as I can see the snippets are identical. I hope someone can spot a difference.
The only difference in the snippets is that the one that works was written from scratch, while the one that doesnt was derived from copy and pasting bits of code from here and there. I suspect that there must be hidden tags or remnants that I cannot see. I am using EditPad Pro as my php editor...could this be a problem???
I really do appreciate coments and suggestions from the php community. just hope I can get this peculiar issue fixed.
Thanx
PS: Have just performed a file comparison on the 2 files above and EditPad Pro says that they are in fact identical......yet when I copy the Nonworking version then PHP just seems to ignore it.....got me scratching the old head!!@#$$@#