Can someone show me a tidier way to output mysql_fetch_array
Posted: Sat Nov 11, 2006 7:39 am
At the moment I'm having the results of mysql_fetch_arry output into a table. Because of this I'm finding I'm closing and opening PHP and HTML tags all over the place. This is what my code looks like at the moment:
As you can see there are open and close tags every couple of lines making it looks horrible. Is there a more tidy way to do this?
Regards,
Code: Select all
$query = mysql_query("SELECT *
FROM customers, jobs
WHERE customers.id = jobs.customerID
");
while($r = mysql_fetch_array($query)) {
?>
<td bgcolor = "CCFFFF">
<?php
echo $r['id'];
echo " ", $r['customer'];
?>
</td>
<?php
}Regards,