Okay, now that the parse error is fixed (fixed by storing the array value into a variable), the thing is that the page keeps coming up blank.
<?php
session_start();
if (isset($_SESSION['access']))
{
if ($_SESSION['access'] == 1)
{
if(!mysql_connect('*****', '*****' , '*****'))
{
echo 'Connection failed. Please try again.';
exit;
}
else
{
$db_link = mysql_connect('*****', '*****', '*****');
if (!mysql_select_db('******', $db_link))
{
echo 'Error selecting database.';
exit;
}
}
$uwonum= $_POST['tutorid'];
$sql = 'SELECT * FROM `Tutor_Info` WHERE `UWO_NUM` = \'$uwonum\' ';
$result = mysql_query($sql,$db_link);
var_dump($result);
}
else
{
echo 'You are not logged in.';
exit;
}
}
while ($row = mysql_fetch_assoc($result))
{
?>
<html>
<form method="post" action="<?php echo $PHP_SELF;?>">
<table border="0" cellspacing="5" cellpadding="0">
<tr>
<td>UWO Number:</td>
<td><input type="text" size="12" maxlength="20" name="UWO_NUM" value = "<?echo $row['UWO_NUM'];?>" ></td>
</tr>
<tr>
<td>Last Name:</td>
<td><input type="text" size="12" name="Last_Name" value = "<?echo $row['Last_Name'];?>"></td>
</tr>
<tr>
<td>First Name:</td>
<td><input type="text" size="12" name="First_Name" value = "<?echo $row['Phone_Num'];?>"> </td>
</tr>
<tr>
<td>Phone Number:</td>
<td><input type="text" size="12" maxlength="10" name="Phone_Num" value = "<?echo $row['Extension'];?>"></td>
</tr>
<tr>
<td>Extension:</td>
<td><input type="text" size="12" maxlength="10" name="Extension" value = "<?echo $row['Hide_Num'];?>"></td>
</tr>
<tr>
<td>Hide Number?</td>
<td><input type="radio" value="Yes" name="Hide_Num"> Yes <input type="radio" value="No" name="Hide_Num"> No</td>
</tr>
<tr>
<td>Email Address:</td>
<td><input type="text" size="12" name="Email_Address" value = "<?echo $row['Email_Address'];?>"></td>
</tr>
<tr>
<td>Faculty:</td>
<td><input type="text" size="12" name="Faculty" value = "<?echo $row['Faculty'];?>"></td>
</tr>
<tr>
<td>Program Name:</td>
<td><select name="Program_Name">
<option value="Science">Science</option>
<option value="MIT">MIT</option>
<option value="SocialSci">Social Science</option>
</select></td>
</tr>
<tr>
<td>Year:</td>
<td><select name="Years_Study">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select></td>
</tr>
<tr>
<td>Bio:</td>
<td><textarea rows="5" cols="20" name="Bios" wrap="physical">Tell us something about yourself!</textarea></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Submit" name="submit"></td>
</table>
</form>
</html>
<?php
}
?>
With the vardump, I only get
resource(3) of type (mysql result)
, on the page.
I don't see what's going wrong here, because a mysql result is fetched, and this should activate the while loop, since there is something. Additionally, the html should be displayed too since it is in the while loop.