Hi,
I would like to know how to display results of database fields in columns on my search form ie.
Here is my code:
<form action="publicationlist.php" method="post">
<p><strong><u>Filter by: </u></strong></p>
<label><strong>By author:</strong><br />
<input name="authors" type="text" id="authors" />
</label>
<label>
<input name="Submit" type="submit" id="Submit" value="Go" />
</label>
<br />
<label><strong><br />
<strong>By availability:</strong><br />
<input name="availability" type="text" id="orgs" size="80" />
</label>
<input name="Submit2" type="submit" id="Submit2" value="Go" />
<br />
<br />
<strong>By sector:</strong><br />
</label>
<?php
$cats = @mysql_query('SELECT id, name FROM category order by name asc');
if (!$cats) {
exit('<p>Error retrieving categories from database!<br />' .
'Error: ' . mysql_error() . '</p>');
}
while ($cat = mysql_fetch_array($cats)) {
$id = $cat['id'];
$name = htmlspecialchars($cat['name']);
echo "<li><a href='publicationlist.php?cat=$id'>$name</a></li>";
}
?>
</form>
I would like to display the results in columns across the page so the user doesn't have to scroll so much. There are about 70 results in total so maybe 3 or 4 columns. Is there a better way to display the results?
Any help would be appreciated.
Thanks