Jump to content

Display database Data horizontaly


ambo

Recommended Posts

This code spits them out vertiacly i cant get them to go horizontal

<?
if(!defined('TBL_ACTIVE_USERS')) {
  die("Error processing page");
}

$q = "SELECT username FROM ".TBL_ACTIVE_USERS
    ." ORDER BY RAND()";
$result = $database->query($q);
/* Error occurred, return given name by default */
$num_rows = mysql_numrows($result);
if(!$result || ($num_rows < 0)){
   echo "Error displaying info";
}
else if($num_rows > 0){
   /* Display active users, with link to their info */
   echo "<table align=\"left\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
   echo "<tr><td><font size=\"2\">\n";
   for($i=0; $i<$num_rows; $i++){
      $uname = mysql_result($result,$i,"username");
      echo "<div align=\"center\"><a href=\"profile.php?user=$uname\">"
  ."<img src=\"../image.php?id=$uname\" width=\"50\" height=\"50\" border=\"0\"/></a><br>"
  ."<a href=\"profile.php?user=$uname\">$uname</a></div>";
   }
   echo "</font></td></tr></table><br>\n";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/146634-display-database-data-horizontaly/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.