i have a table of records with hyperlinks to check details of each record:
<td><a href=\"details1.php?ApplicationNo=" . $row['ApplicantDetails.ApplicationNo'] . "\">Details</a></td>
in the details1.php script, I extract the data from the database:
$query1 = "SELECT * FROM ApplicantDetails WHERE ApplicationNo='$ApplicationNo'";
$result1 = mysql_query($query1)
or die ("Couldn't execute query 1.");
$row1 = mysql_fetch_array($result1);
@extract($row1);
and display them in forms, for example:
<tr>
<td align='right'> Title </td>
<td> <input type='text' maxlength='40' size='40' name='App_Title' value='$App_Title'/>
</td>
</tr>
Problem: it works fine at times but at other times when i go back to the first page to check details for ANOTHER application number, it still displays details for the previous application number viewed. I did 'view source' and ApplicationNo was correctly transferred for each record
I guess it has to do with the 'extract' statement. PHP manual (http://www.php.net/manual/en/function.extract.php) indicates that the default is EXTR_OVERWRITE where 'If there is a collision, [it] overwrite the existing variable'. Apparently the overwrite function fails at those times(?). Is there a way to get around this?
I tried explicitly using the overwrite function:
@extract($row1, EXTR_OVERWRITE)
it doen't work either!