hello all. i have this code...
<?php
$query= "SELECT * FROM table";
$result=mysql_query($query) or die(mysql_error());
$num_rows = mysql_num_rows($result);
if($num_rows>=1)
{
echo "<table border=0>";
while($row = mysql_fetch_array($result))
{
echo "<td>" . $row['data'] . "," . "</td>";
}
echo "</table>";
}
?>
lets say it is displaying from 5 records, it is displaying this way:
data1, data2, data3, data4, data5,
and i'd like it to be displayed without the comma following the last record and WITH an "&" preceding the last record in this way:
data1, data2, data3, data4, & data5
any ideas?