How to display info horizonatally
Posted: Sun Jun 13, 2010 4:33 pm
Hello All,
I was wondering if someone could guide me a little. I have this code I am working on, but it displays 1 line at a time. Basically what I want is to break it up so that it dispalys across instead of down, but it sections. Each section will be VISITOR (w/logo) then line 2 SPREAD, then line 3 HOME (w/logo)
Section 1 ; section 2; section 3; ......etc
not
visitor (w/logo)
spread
Home (w/logo)
visitor (w/logo)
spread
Home (w/logo)
visitor (w/logo)
spread
Home (w/logo) ... etc
Here is the code I am working with:
Any help would be appreciated.
Thanks,
Patsman77
I was wondering if someone could guide me a little. I have this code I am working on, but it displays 1 line at a time. Basically what I want is to break it up so that it dispalys across instead of down, but it sections. Each section will be VISITOR (w/logo) then line 2 SPREAD, then line 3 HOME (w/logo)
Section 1 ; section 2; section 3; ......etc
not
visitor (w/logo)
spread
Home (w/logo)
visitor (w/logo)
spread
Home (w/logo)
visitor (w/logo)
spread
Home (w/logo) ... etc
Here is the code I am working with:
Code: Select all
<?
$sql = "SELECT * FROM ".$football->prefix."picks, ".$football->prefix."schedule, ".$football->prefix."teams WHERE USER = '".$user."' AND week = '".$week."' AND ".$football->prefix."picks.gameid = ".$football->prefix."schedule.gameid AND ".$football->prefix."picks.pick = ".$football->prefix."teams.id ORDER BY ".$football->prefix."schedule.gametime, ".$football->prefix."schedule.gameid";
$result = $football->dbQuery($sql);
$nRows = mysql_num_rows($result);
$upicks = "";
for ($i=0; $i< $nRows; $i++){
$row = mysql_fetch_array($result);
$pickcity = $row['city'];
$pickname = $row['name'];
$gameid = $row['gameid'];
$pick = $row['pick'];
$sql="select ".$football->prefix."schedule.*, ".$football->prefix."teams.city as VCity, ".$football->prefix."teams.name as VName, ".$football->prefix."teams.display as VDisplayName, ".$football->prefix."teams.icon as Vicon, teams2.city as HCity, teams2.name as HName, teams2.display as HDisplayName, teams2.icon as Hicon from (".$football->prefix."schedule inner join ".$football->prefix."teams on ".$football->prefix."schedule.vid = ".$football->prefix."teams.id) inner join ".$football->prefix."teams as teams2 on ".$football->prefix."schedule.hid = teams2.id where ".$football->prefix."schedule.gameid = '".$gameid."'";
$pickresult = $football->dbQuery($sql);
$prow = mysql_fetch_array($pickresult);
$game = "";
$vid = $prow['vid'];
$vcity = $prow['VCity'];
$vname = $prow['VName'];
$vicon = $prow['Vicon'];
$hid = $prow['hid'];
$hcity = $prow['HCity'];
$hname = $prow['HName'];
$hicon = $prow['Hicon'];
$gametime = $prow['gametime'];
$date = date("m/d/Y",$gametime);
$time = date("H:i:s A",$gametime);
$ts = $football->doDate($date,$time,$football->display_offset);
$day = date("D",$ts);
$month = date("M d",$ts);
$time = date("g:i a",$ts);
if ($vid == $pick) {
$visitor = "<b><u>";
$visitor .= $vid;
$visitor .= "</b></u>";
}
else {
$visitor = $vid;
}
echo "$visitor";
echo "<img src = \"".$football->copyrightweb."/images/$vicon\" width=".$football->logo_width.">\n";
if ($hid == $pick) {
$home = "<b><u>";
$home .= $hid;
$home .= "</b></u>";
}
else {
$home = $hid;
}
echo "<br>at<br> $home";
echo "<img src = \"".$football->copyrightweb."/images/$hicon\" width=".$football->logo_width.">";
echo "</tr>\n";
}
echo "</table>\n";
echo "<br><br><br><b>TB: ".$tb."</b>\n";
echo "<br><br>\n";
?> Thanks,
Patsman77