Here is the code for Page-1. Note that it is in progress but should work as is.
<html>
<head>
<script type="text/javascript">
function showUser(str)
{
if (str=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","AjaxGetUser.php?q="+str,true);
xmlhttp.send();
}
</script>
</head>
<body>
<form>
<select name="users" onChange="showUser(this.value)">
<option value="">Select a person:</option>
<option value="1">person 1</option>
<option value="2">person 2</option>
<option value="3">person 3</option>
</select>
</form>
<br />....................................................................all of the above code works as it should.
<?php echo "Row count: " . $num ."</br>"; ?>............................this does not return $num only a blank. WHY??????
…If I can remedy the above line then I can fix the whole thing.
Person info will be listed here-1.
…the table headers below do appear but none of the detail lines below that.
<table id="mysqlTable">
<tr>
<td>
<font face="Arial, Helvetica, sans-serif">Row Count</font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Season</font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Comp Number</font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">First Name</font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Last Name</font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Initials</font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Digital Class</font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Print Class</font>
</td>
</tr>
<tr>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $field[season][1]; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $field[compnum][1]; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $field[fname][1]; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $field[lname][1]; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $field[initials][1]; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $field[compclass][1]; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $field[printclass][1]; ?></font>
</td>
</tr>
<tr>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $field[season][2]; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $field[compnum][2]; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $field[fname][2]; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $field[lname][2]; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $field[initials][2]; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $field[compclass][2]; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $field[printclass][2]; ?></font>
</td>
</tr>
</table>
<div id="txtHint2"><b>Person info will be listed here.</b></div>
</body>
</html>