Hi. I'm trying to get my hover-effect to work , but the php seems to destroy the hoverfunction. My javascript works fine if I remove all php-code. What have I done wrong?

$host="*********"; // Host name 
$username="**********"; // Mysql username 
$password="geronimo"; // Mysql password 
$db_name="***********"; // Database name
$tbl_name="****"; // Table name
mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
mysql_select_db("$db_name")or die("cannot select DB");
$sql="SELECT * FROM $tbl_name ORDER BY nummer";
<hr width="520" color="#FFF" size="1px" />
<table align="center" width="520" border="0" cellpadding="4" cellspacing="2" class="table2">
          <td width="60" height="80" align="left" class="bread"><? echo $rows['nummer']; ?></td>
          <td width="223" align="left" class="bread"><? echo $rows['titel']; ?></td>
          <td width="78" align="center" class="bread"><? echo $rows['pris']; ?></td>
          <td width="117" align="center" valign="middle">
          <a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','../../images/uppdatera.png',1)"><img src="../../images/uppdatera2.png" name="Image1" width="120" height="27" border="0" id="Image2" /></a><br />
          <a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image2','','../../images/tabort1.png',1)"><img src="../../images/tabort2.png" name="Image2" width="120" height="27" border="0" id="Image2" /></a><br />
  <?php } ?>
  <?php mysql_close($con); ?>
4 Years
Discussion Span
Last Post by Vingklippt

make sure the javascript file is referenced by this page. Otherwise the MM_swapImgRestore and MM_swapImage functions will be undefined js functions. Make sure of that and please let us know.

Edited by veedeoo: info added

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.