To be honest, I'm not sure if my issue lies with php or with javascript. I have two entries in a database appearing within a table that allows the user to click an arrow for contact information to appear below the listing. The first entry turned out perfectly, but the second entry is no good.

Site: Forever Pets - Vet Cost Comparison Chart

The second listing brings up the table headings again and the icon brings up the contact info for the first entry. I'm not sure if I went about it the easiest or even possible way, but I'm not familiar with things enough to know any better.

Any ideas on how I can get the effect I'm looking for?

Php Code:
PHP Code:
<?php

$dbh 
mysql_connect($hostname$username$password
or die(
"Unable to connect to MySQL");
mysql_select_db ("BsnsDirectory"$dbh);
$query sprintf("SELECT * FROM vets");
$result mysql_query($query);


if (!
$result) {
$message  'Invalid query: ' mysql_error() . "\n";
$message .= 'Whole query: ' $query;
die(
$message);
}


while (
$row mysql_fetch_assoc($result)) {
   
echo 
"<table class=\"tableform\" style='WORD-BREAK:BREAK-ALL' 
border:1px solid #000000' cellpadding='3' cellspacing='3'>
<tr>
<th><b><u>Clinic Name</u></b></td>
<th><b><u>Intersection</u></b></td>
<th><b><u>Basic Examination</u></b></td>
</tr>

<tr><td>
<a href='#' onclick=\"return hidify_showify('contactinfo','search_arrow','Shrink','Details');\">
<img src='img/arrow_down.gif' alt='Details' border='0' id=\"search_arrow\" /></a>&nbsp;"
.$row['company']."</td>
<td>"
.$row['intersection']."</td><td>$".$row['examine']."</td></tr>
        
<tr><td id=\"contactinfo\">
<table class=\"tableform2\">
<tr><td>"
.$row['address']."</td></tr>
<tr><td>"
.$row['city'].",\n".$row['province']."</td></tr>
<tr><td>"
.$row['postal']."</td></tr>
<tr><td><b>Phone:</b>&nbsp;"
.$row['phone']."</td></tr>
<tr><td><b>Emerg Phone:</b>&nbsp;"
.$row['emergphone']."</td></tr>
<tr><td><b>eMail:</b>&nbsp;"
.$row['email']."</td></tr>
<tr><td><b>Website:</b>&nbsp;"
.$row['Website']."</td></tr>
</table>

</td></tr></table>"
;

}

mysql_free_result($result);
?>
Javascript:
Code:
function hidify_showify(e_table, e_img, alt_less, alt_more) {
   if(document.getElementById) {
      var id_table = document.getElementById(e_table).style;
      var id_img = document.getElementById(e_img);

      //Set the object to table-cell if the browser is
      //Firefox and block if it's anything else.
      if(navigator.userAgent.indexOf("Firefox") != -1){
         if(id_table.display == "table-cell") {
            id_table.display = "none";
            id_img.src = "img/arrow_down.gif";
            id_img.alt = alt_more;
         }
         else {
            id_table.display = "table-cell";
            id_img.src = "img/arrow_up.gif";
            id_img.alt = alt_less;
         }
      }
      else {
         if(id_table.display == "block") {
            id_table.display = "none";
            id_img.src = "img/arrow_down.gif";
            id_img.alt = alt_more;
         }
         else {
            id_table.display = "block";
            id_img.src = "img/arrow_up.gif";
            id_img.alt = alt_less;
         }
      }
      return false;
   }
   else {
      return true;
   }
}
stylesheet.css
Code:
#contactinfo {
	display: none
}