Forum Moderators: coopster
Here is code:
while ($row= mysql_fetch_array($rs))
{
$list.="<tr>";
$list.="<td><a href=namesearch3.php $meta=mysql_fetch_field($rs)>".$row["hospnum"]."</a></td>";
$list.="<td>".$row["fstname"]."</td>";
$list.="<td>".$row["surname"]."</td>";
$list.="<td>".$row["dob"]."</td>";
$list.= "</tr>";
}
echo($meta);
$list.="</table>";
echo(<INPUT TYPE="hidden" onClick="this.form.submit('newsearch3.php<?php echo($meta=mysql_fetch_field($rs);?>')" name="submit">
echo($list);
?>
first of all you've scrambled up your php tags. secondly, you're trying to define a variable inside another one. never mind. anyway, what's your intention in using mysql_fetch_field($rs)? isn't it the same field you're getting throughout the loop? why not directly use the field name instead..
take a look at this..
while ($row = mysql_fetch_array($rs))
{
$list.="<tr>";
$list.="<td><a href=namesearch3.php?[b]hospnum[/b]=".$row["hospnum"].">".$row["hospnum"]."</a></td>";
$list.="<td>".$row["fstname"]."</td>";
$list.="<td>".$row["surname"]."</td>";
$list.="<td>".$row["dob"]."</td>";
$list.= "</tr>";
}
$list.="</table>";
echo "<INPUT TYPE=\"hidden\" onClick=\"this.form.submit('newsearch3.php?hospnum=')\" name=\"submit\">";
echo$list;