Near the bottom, (you'll see a comment with a lot of room) the variable shows up instead of the data inside the variable.
<html><head><LINK REL=stylesheet HREF="style.css" TYPE="text/css"></head>
<?php
//Put this here for now
//Connect to the database, or die trying
$dbh=mysql_connect ("localhost", "sharabas_zudo") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("sharabas_zoid");
//Make your query get stuff that's like the search, then the result
$query = "select * from zoid_buttons ORDER BY `name`";
$result = mysql_query($query);
$result2 = mysql_query($query);
//Get the number of rows so we know how many times to loop
$num_row = mysql_num_rows($result);
//Start the java script
echo"<head><SCRIPT LANGUAGE=\"JavaScript\">";
//Make the image loop
$i=1;
for ($a = 0; $a < $num_row; $a++) {
//Get the next row
$row = mysql_fetch_array($result);
//Make the javascript loop
echo"image$i = new Image();";
echo"image$i.src = \"buttons/$row2[2].jpg\";";
$i++;
}
//Stop the java and start the body!
echo"</script></head><body>";
//stuff to stop the bug
$i=1;
//Make the link loop
for ($a = 0; $a < $num_row; $a++) {
//Get the next row
$row2 = mysql_fetch_array($result2);
echo"<a href=\"$row2[1].php\" target=\"space\" onmouseover=\"image$i.src='buttons/"$row2[3]".jpg';\";";
echo"onmouseout=\"image$i.src='buttons/"$row2[2]".jpg';\">";
echo"<img name=\"image$i\" src=\"buttons/"$row2[2]".jpg\" ";
//"$row2[2]" shows up when you view the source, instead of the data in that array
echo"border=0></a><br>";
$i++;
}
echo"</body>";
echo"</html>";
?>