Multiple Collumns of results
Posted: Tue Aug 05, 2003 1:40 am
I'm trying to make my results in 2 columns. Right now the results get outputted to the browser in a single column. Any Ideas?
I want to go from this:
1
2
3
4
To this:
1 2
3 4
I've read tutorials online and no dice. I'm still confused.
I want to go from this:
1
2
3
4
To this:
1 2
3 4
I've read tutorials online and no dice. I'm still confused.
Code: Select all
<?
if (!$cat){
$cat = "business";
}
require("templatesettings.php");
$db_connect = mysql_connect($sqlhostname,$login,$password);
$base_selection = mysql_select_db($base,$db_connect);
$query = "SELECT * FROM templates WHERE category = '$cat'";
$req = mysql_query($query);
if (!$req)
{ echo "<B>Error ".mysql_errno()." :</B> ".mysql_error()."";
exit; }
$res = mysql_num_rows($req);
if ($res == 0)
{ echo "<center><b>Sorry there are no templates in this category yet.</b></center>";}
else
{ while($row = mysql_fetch_array($req))
{
extract($row);
if ($rating == 0 || $votes == 0){
$showrate = 0;
} else {
$showrate = round($rating/$votes, 1);
}
print( "<table width="300" cellspacing="0" cellpadding="5">\n" );
print( " <tr>\n" );
print( " <td><img src="$thumb" width="100" height="80" border="0" alt="Screenshot of Template #$ID"></td>\n" );
print( " <td align="right">Author: $author<br />\n" );
print( "Downloads: $download<br />\n" );
print( "Rating: $showrate<br />\n" );
print( "<form action="rate.php" method="post">\n" );
print( "<select name="rating">\n" );
print( "<option value="5">EXCELENT</option>\n" );
print( "<option value="4">VERY GOOD</option>\n" );
print( "<option value="3">GOOD</option>\n" );
print( "<option value="2">FAIR</option>\n" );
print( "<option value="1">POOR</option>\n" );
print( "</select><input name="id" type="hidden" value="$ID">\n" );
print( " <input type="submit" value="Vote!">\n" );
print( "</form>" );
print( "</td>\n" );
print( " </tr>\n" );
print( " <tr>\n" );
print( " <td colspan="2" align="center">\n" );
print( " <a href="$get" target="_BLANK">DOWNLOAD</a> | <a href="$view" target="_BLANK">VIEW</a>\n" );
print( " </td>\n" );
print( " </tr>\n" );
print( "</table>\n" );
print( "<hr size="1" noshade color="black"><br />\n" );
}
mysql_free_result($req);
}
?>