Hi Craig - thanks for replying. I have posted the rest of the code below (except the code for connecting and opening the database, I've also taken out the error messages etc. This code generates a list of surnames (found in the 3rd element of the row[] array, i.e. row[2]). $name holds the data formatted as an anchor so that I can test for a mouseover. But when I mouse over the surname, I get an error message - that the VALUE contained in the element is an undefined variable. Any help would be gratefully received. Thanks, Tony.
$mainSQL="SELECT * FROM main
Order by surname";
$result=mysql_query($mainSQL,$link);
echo ("<table width='80%' border='0' cellpadding='3'>");
for ($i = 0; $row=mysql_fetch_row($result); $i++)
{
$name = "<a href='#'
onMouseover='alert( " .
$row[1] .
")" .
"'>" .
$row[2] .
"</a>";
echo ("<tr><td valign='top'>
<span style='font-family: verdana;
color: navy;
font-size: 11px; '>
$name
</span>
</td> </tr>");
}
echo("</table>");
?>