onthespot Posted July 22, 2009 Share Posted July 22, 2009 if ($_GET[type] == "") { $leagues = mysql_query("SELECT `user` , `team` , `home_games_played` ,`home_wins` ,`home_draws` ,`home_losses` , `home_points` , `home_goals_for` , `home_goals_against` , `away_games_played` , `away_wins` ,`away_draws` ,`away_losses` , `away_points` , `away_goals_for` , `away_goals_against` , `home_games_played` + `away_games_played` , `home_goals_for` + `away_goals_for` , `home_goals_against` + `away_goals_against` ,(`home_goals_for` + `away_goals_for`) - (`home_goals_against` + `away_goals_against`) , `home_points` + `away_points` FROM `$_GET[comp]` ORDER BY `home_points` + `away_points` DESC, (`home_goals_for` + `away_goals_for`) - (`home_goals_against` + `away_goals_against`) DESC, `home_goals_for` + `away_goals_for` DESC"); echo "<h1 class=\"pagetitle\">$info[2] Combined Table</h1>"; echo"<table cellspacing=\"3\" cellpadding=\"10\" style='border: 1px dotted;' bgcolor=\"#eeeeee\"> <tr > <th style='border-bottom: 1px dotted;'>#</th> <th style='border-bottom: 1px dotted;' width=\"250\">User</th> <th style='border-bottom: 1px dotted;'>Played</th> <th style='border-bottom: 1px dotted;'>Wins</th> <th style='border-bottom: 1px dotted;'>Draws</th> <th style='border-bottom: 1px dotted;'>Losses</th> <th style='border-bottom: 1px dotted;'>GF</th> <th style='border-bottom: 1px dotted;'>GA</th> <th style='border-bottom: 1px dotted;'>GD</th> <th style='border-bottom: 1px dotted;'>Points</th> </tr>"; while( $row = mysql_fetch_assoc($leagues)) { extract($row); $info = explode("_",$row[comp_name]); $TotalGP = $home_games_played + $away_games_played ; $TotalW = $home_wins + $away_wins ; $TotalD = $home_draws + $away_draws ; $TotalL = $home_losses + $away_losses ; $TotalGF = $home_goals_for + $away_goals_for ; $TotalGA = $home_goals_against + $away_goals_against ; $TotalPts = $home_points + $away_points ; $TotalGD = $TotalGF - $TotalGA; echo" <tr> <td>$p</td> <td>$user ($team)</td> <td>$TotalGP</td> <td>$TotalW</td> <td>$TotalD</td> <td>$TotalL</td> <td>$TotalGF</td> <td>$TotalGA</td> <td>$TotalGD</td> <td>$TotalPts</td> </tr>"; $p++; } echo "</table>"; } Any ideas why the cellpadding wont work? Quote Link to comment Share on other sites More sharing options...
jeff5656 Posted July 22, 2009 Share Posted July 22, 2009 Maybe it has something to do with the quotation marks in the echo statement. You probably should ask over in the PHP help forum to see if that's the reason. Quote Link to comment Share on other sites More sharing options...
onthespot Posted July 22, 2009 Author Share Posted July 22, 2009 I did and someone moved it here? Quote Link to comment Share on other sites More sharing options...
kinks Posted July 22, 2009 Share Posted July 22, 2009 I have had a similar code befor, it worked when it was like this: echo"<table cellspacing='3' cellpadding='10'style='border: 1px dotted;' bgcolor='#dfdfdf'> But, not sure, try replacing that echo code, and see what happens. Quote Link to comment Share on other sites More sharing options...
haku Posted July 23, 2009 Share Posted July 23, 2009 It was moved here because it's an HTML problem, not a php problem. Run your script and paste the generated HTML output here. Quote Link to comment Share on other sites More sharing options...
SuperBlue Posted July 23, 2009 Share Posted July 23, 2009 Why would you want to echo out the entire HTML when you can just escape in and out from php? Hence avoid coding horror of excaping quotes, or resorting to string concatenation. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.