display search results Horizontally
Posted: Sat Feb 20, 2010 3:37 pm
hi i have this code which displays search results vertically, how do i display results horizontally like 4 records in per row.
Code: Select all
<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
?>
<php?
mysql_connect("localhost","user1","password");
mysql_select_db("dbimages");
$search=$_POST["search"];
$field=$_POST["field"];
if ($search == "")
{
echo "<p>You forgot to enter a search term";
exit;
}
$result = mysql_query("SELECT * FROM tblimg WHERE upper($field) LIKE '%$search%'");
while($r=mysql_fetch_array($result))
{
$title=$r["firstname"];
$message=$r["surname"];
$imgurl=$r["imgurl"];
echo "$id <br> $title <br> $message <br> $imgurl <br>";
}
?>