Guys,
Thanks for your interest.
As you can imagine I have been working at this myself and (with a little help from others) cracked the answer about 1/2 an hour ago: as you have suggested, the answer lies with the 'form code'. First I did a var_dump on the $row values and got a NULL return - obviously they were not being populated. Then I looked at why this might be and, trying one thing after another, came up with the solution that the 'While' loop was the root cause. When I took it ot and ran the code as a function - it all worked!!!
For your info, here is the preceeding code:
- Code: Select all
if (isset($_GET['view']))
{
$user = sanitizeString($_GET['view']);
$data = "SELECT * FROM `qualifications` WHERE email='$user'";
$result=mysql_query($data) or die(mysql_error());
while($row=mysql_fetch_array($result)){
?>
<table style="background-color:#F0F8FF; border='1px'; font-weight: bold;" >
<caption>Personal Record</caption>
<tr>
<th>QUAL_ID</th>
<td><?php
echo $row['qual_id'];
?></td>
</tr>
<tr>
<th>Name</th>
<td><?php
echo $row['name'];
?></td>
</tr>
<tr>
<th>E-Mail</th>
<td><?php
echo $row['email'];
?></td>
</tr>
<tr>
<th>Exped</th>
<td><?php
echo $row['exped'];
?></td>
</tr>
<tr>
<th>Main Telephone</th>
<td><?php
echo $row['supervisor_cse'];
?></td>
</tr>
<tr>
<th>Assessor Cse</th>
<td><?php
echo $row['assessor_cse'];
?></td>
</tr>
<tr>
<th>Low Level Hills</th>
<td><?php
echo $row['lowlevel_hills'];
?></td>
</tr>
<tr>
<th>MLT Summer</th>
<td><?php
echo $row['mltsummer'];
?></td>
</tr>
<tr>
<th>MLT Winterr</th>
<td><?php
echo $row['mltwinter'];
?></td>
</tr>
<tr>
<th>1st Aid</th>
<td><?php
echo $row['firstaid'];
?></td>
</tr>
<tr>
<th>Other Quals</th>
<td><?php
echo $row['other_quals'];
?></td>
</tr>
<tr>
<th>Intro to DoE</th>
<td><?php
echo $row['doe_intro'];
?></td>
</tr>
<tr>
<th>Disclosure</th>
<td><?php
echo $row['disclosure'];
}
}
?></td>
</tr>
</table>
<br />
<form method="post" action="quals.php">
<input name="Submit1" type="submit" value="Edit" style="width: 67px" /></form>
All I did was remove the 'while' loop and {}s and left the sql-array to run itself and - hey presto - it populated the email $message values.
Don't worry that the email '$message' and the $rows do not match - this is just generic code to get the thing up-and-running. Now I know that all code works I'll build the thing properly.
I am so grateful for your time - I feel certain, from the way you were beginning to look, that you would have come up with this solution too. Thank You.
This can be marked as 'Solved'.
Regards,
'H'