element IDs inside loops?
Posted: Sun Apr 19, 2009 1:23 pm
I'm having trouble with this bit of code:
The problem lies with this td id = 'space".$i."' which im trying to set a unique ID for each while pass and them be able to call a specific ID via javascript. I am to utilize the first instance of the id "space" but thats it. any ideas on what im doing wrong?
Code: Select all
while($rows=mysql_fetch_array($result)){
if(is_odd($i)){
echo "<tr class = 'odd'>";
} else {
echo " <tr>";
}
echo"<td>".$rows['JID']."</td>
<td>".$rows['CID']."</td>
<td>".$rows['fdate']."</td>
<td class = 'bunked'><ul><li>".$rows['pname']."</li>
<li class = 'bunked'>".$rows['zname']."</li></ul></td>
<td class = 'bunked'><ul><li>".$rows['name']."</li>
<li class = 'bunked'>".$rows['address']."</li></ul></td>
<td class = 'bunked'><ul><li>".formatPhone($rows['home'])."</li>
<li class = 'bunked'>".formatPhone($rows['cell'])."</li></ul></td>
<td>".$rows['summary']."</td>
</tr>
<tr class='space'><td id = 'space".$i."' colspan = '7'></td></tr>";
$i++;
}