
Smee
Members-
Posts
55 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
Smee's Achievements

Member (2/5)
0
Reputation
-
Thanks for the info again... Can't belive it was just not closing a href!
-
Adding anything after this removes the link from the table and does not show what you have tried to add to the page. <td><a target="_blank" href="http://news.bbc.co.uk/sport1/hi/football/teams/b/birmingham_city/fixtures/default.stm> Fixtures</a></td> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="icon" type="image/png" href="../images/favicon.png"/> <title>Team Fixture Lists</title> <style type="text/css" mdeia="screen"> @import "./includes/layout.css"; </style> </head> <body background="../images/background.png"> <div id="container"> <div id="slimtop"> </div> <div id="small_login"> <form action="login.php" method="post"> <p class="email"> <label> E-Mail: </label> <input type="text" name="email" id="email" value=""/> </label> <p class="password"><label> Password: </label> <input type="password" name="pass" maxlength="20" /> <p class="submit"> <input type="submit" name="submit" value="Login" /> </form> </div> <div id="ft_logo"> </div> <div id="middle_container"> <div id="navigation_container"> <div id="navigation_header"> </div> <p><img src="/images/home.png" width="20" height="20" alt="home" title="home" align="baseline" border="0" hspace="10" /><a href="index.php">Home<br /></a></p> <p><img src="/images/register.png" width="20" height="20" alt="Register" title="Register" align="baseline" border="0" hspace="10" /><a href="register.php">Register<br /></a></p> <p><img src="/images/navbarlogin.png" width="20" height="20" alt="Login" title="Login" align="baseline" border="0" hspace="10" /><a href="login.php">Login<br /></a></p> <p><img src="/images/forgotpassword.png" width="20" height="20" alt="Forgot Password" title="Forgot Password" align="baseline" border="0" hspace="10" /><a href="forgot_password.php">Forgot Password<br /></a></p> <p><img src="/images/aboutus.png" width="20" height="20" alt="About Us" title="About Us" align="baseline" border="0" hspace="10" /><a href="aboutus.html">About Us<br /></a></p> <p><img src="/images/fixtures.png" width="20" height="20" alt="Fixtures" title="Fixtures" align="baseline" border="0" hspace="10" /><a href="fixtures.php">Team Fixtures<br /></a></p> <img src="/images/forums.png" width="20" height="20" alt="Football Trip.net Forums" title="Football Trip.net Forums" align="baseline" border="0" hspace="10" /><a href="forums" target="_blank">Forums</a> <div id="third_party_links"> <img src="../images/facebook_32.png" width="32" height="32" alt="Football Trip.net Facebook" title="Football Trip.net Facebook" align="baseline" border="0" hspace="9" /><a href="" target="_blank"></a> <img src="../images/twitter_32.png" width="32" height="32" alt="Football Trip.net Twitter" title="Football Trip.net Twitter" align="baseline" border="0" hspace="9" /><a href="" target="_blank"></a> <img src="../images/email_32.png" width="32" height="32" alt="E-Mail Football Trip.net" title="E-Mail Football Trip.net" align="baseline" border="0" hspace="9" /><a href="" target="_blank"></a> </div> </div> <!-- End of Header !--> <div id="fixture_content_container"> <div id="content_header"> </div> <h1> Search Team Fixture Lists <br /> <br /> <p>To view your teams fixture list please use the search function below. </p> <p> ** For legal reasons Football Trip.net are not allowed to list fixtures on the site.**</p></h1> <div id="fixture_search"> <form action="fixtures.php" method="post" /> <p class="team_name"><label> Football Team Supported: </label> <select name="team_name"> <option>Accrington Stanley</option> <option>Aldershot</option> <option>Arsenal</option> <option>Aston Villa</option> <option>Barnet</option> <option>Barnsley</option> <option>Birmingham City</option> <option>Blackburn Rovers</option> <option>Blackpool</option> <option>Bolton</option> <option>Bournemouth</option> <option>Bradford City</option> <option>Brentford</option> <option>Brighton</option> <option>Bristol City</option> <option>Bristol Rovers</option> <option>Burton Albion</option> <option>Bury</option> <option>Cardiff City</option> <option>Carlisle</option> <option>Charlton Athletic</option> <option>Chelsea</option> <option>Cheltenham Town</option> <option>Chesterfield</option> <option>Colchester United</option> <option>Coventry City</option> <option>Crewe Alexandra</option> <option>Crystal Palace</option> <option>Dagenham and Redbridge</option> <option>Darlington</option> <option>Derby County</option> <option>Doncaster Rovers</option> <option>Everton</option> <option>Exeter City</option> <option>Fulham</option> <option>Gillingham</option> <option>Grimsby Town</option> <option>Hartlepool United</option> <option>Hereford United</option> <option>Huddersfield Town</option> <option>Hull City</option> <option>Ipswich Town</option> <option>Leeds United</option> <option>Leicester City</option> <option>Leyton Orient</option> <option>Lincoln City</option> <option>Liverpool</option> <option>Macclesfield Town</option> <option>Manchester City</option> <option>Manchester United</option> <option>Middlesbrough</option> <option>Millwall</option> <option>Milton Keynes Dons</option> <option>Morecambe</option> <option>Newcastle United</option> <option>Northampton Town</option> <option>Norwich</option> <option>Nottingham Forest</option> <option>Notts County</option> <option>Oldham Athletic</option> <option>Peterborough United</option> <option>Plymouth Argyle</option> <option>Port Vale</option> <option>Portsmouth</option> <option>Preston North End</option> <option>Queens Park Rangers</option> <option>Reading</option> <option>Rochdale</option> <option>Rotherham United</option> <option>Scunthorpe United</option> <option>Sheffield United</option> <option>Sheffield Wednesday</option> <option>Shrewsbury Town</option> <option>Southampton</option> <option>Southend United</option> <option>Stockport</option> <option>Stoke City</option> <option>Sunderland</option> <option>Swansea City</option> <option>Swindon Town</option> <option>Torquay United</option> <option>Tottenham Hotspur</option> <option>Tranmere Rovers</option> <option>Wallsall</option> <option>Watford</option> <option>West Bromwich Albion</option> <option>West Ham United</option> <option>Wigan Athletic</option> <option>Wolverhampton Wanderers</option> <option>Wycombe Wanderers</option> <option>Yeovil Town</option> </select> <p class="submit"> <input type="submit" name="submit" value="Search" /> </form> </div> <div id="fixtures_confirmation"> <table width="600" height="100" border="0" /> <thead> <tr> <th scope="col">Team Name</th> <th scope="col">Fixture List URL</th> </tr> </thead> <tbody> <tr> <td>Birmingham City</td> <td><a target="_blank" href="http://news.bbc.co.uk/sport1/hi/football/teams/b/birmingham_city/fixtures/default.stm> Fixtures</a></td> </tr> </tbody> </table> </div> <!-- End of Content --!> </div> </body> </html>
-
I will try and make it a bit clearer. The form is showing the right results as the page is. The only problem is when i try to add anything whether it is an image, divs or even text the team name shows but the fixture link is removed and nothing is being shown. So anything added after this means that the fixture link is removed and whatever you have tried to add does not show up either. <td><a target="_blank" href="'.$_SESSION['indexsearch_result']['url'].'> Fixtures</a></td> <?php # register.php // This is the registration script for the site require_once ('./includes/config.inc.php'); // Set the page title and header $page_title = 'Team Fixture Lists'; include ('./includes/header.html'); ?> <div id="fixture_content_container"> <div id="content_header"> </div> <h1> Search Team Fixture Lists <br /> <br /> <p>To view your teams fixture list please use the search function below. </p> <p> ** For legal reasons Football Trip.net are not allowed to list fixtures on the site.**</p></h1> <div id="fixture_search"> <form action="fixtures.php" method="post" /> <p class="team_name"><label> Football Team Supported: </label> <select name="team_name"> <option>Accrington Stanley</option> <option>Aldershot</option> <option>Arsenal</option> <option>Aston Villa</option> <option>Barnet</option> <option>Barnsley</option> <option>Birmingham City</option> <option>Blackburn Rovers</option> <option>Blackpool</option> <option>Bolton</option> <option>Bournemouth</option> <option>Bradford City</option> <option>Brentford</option> <option>Brighton</option> <option>Bristol City</option> <option>Bristol Rovers</option> <option>Burton Albion</option> <option>Bury</option> <option>Cardiff City</option> <option>Carlisle</option> <option>Charlton Athletic</option> <option>Chelsea</option> <option>Cheltenham Town</option> <option>Chesterfield</option> <option>Colchester United</option> <option>Coventry City</option> <option>Crewe Alexandra</option> <option>Crystal Palace</option> <option>Dagenham and Redbridge</option> <option>Darlington</option> <option>Derby County</option> <option>Doncaster Rovers</option> <option>Everton</option> <option>Exeter City</option> <option>Fulham</option> <option>Gillingham</option> <option>Grimsby Town</option> <option>Hartlepool United</option> <option>Hereford United</option> <option>Huddersfield Town</option> <option>Hull City</option> <option>Ipswich Town</option> <option>Leeds United</option> <option>Leicester City</option> <option>Leyton Orient</option> <option>Lincoln City</option> <option>Liverpool</option> <option>Macclesfield Town</option> <option>Manchester City</option> <option>Manchester United</option> <option>Middlesbrough</option> <option>Millwall</option> <option>Milton Keynes Dons</option> <option>Morecambe</option> <option>Newcastle United</option> <option>Northampton Town</option> <option>Norwich</option> <option>Nottingham Forest</option> <option>Notts County</option> <option>Oldham Athletic</option> <option>Peterborough United</option> <option>Plymouth Argyle</option> <option>Port Vale</option> <option>Portsmouth</option> <option>Preston North End</option> <option>Queens Park Rangers</option> <option>Reading</option> <option>Rochdale</option> <option>Rotherham United</option> <option>Scunthorpe United</option> <option>Sheffield United</option> <option>Sheffield Wednesday</option> <option>Shrewsbury Town</option> <option>Southampton</option> <option>Southend United</option> <option>Stockport</option> <option>Stoke City</option> <option>Sunderland</option> <option>Swansea City</option> <option>Swindon Town</option> <option>Torquay United</option> <option>Tottenham Hotspur</option> <option>Tranmere Rovers</option> <option>Wallsall</option> <option>Watford</option> <option>West Bromwich Albion</option> <option>West Ham United</option> <option>Wigan Athletic</option> <option>Wolverhampton Wanderers</option> <option>Wycombe Wanderers</option> <option>Yeovil Town</option> </select> <p class="submit"> <input type="submit" name="submit" value="Search" /> </form> </div> <div id="fixtures_confirmation"> <?php $error = null; if(isset($_POST['submit'])){ // Search form // Do the search query here first: require_once ('../mysql_connect.php'); // Santize Post code and team supported. (Santitize both, never use trim or other similar functions when santizing input.) if ( mysql_real_escape_string( $_POST['team_name']) ) { // Select every column from the table where conditions match: $query = "SELECT * FROM teams WHERE team_name LIKE '%" . $_POST['team_name'] . "%'"; $result = mysql_query($query) or trigger_error("Query: $query\n<br />MySQL Error: ".mysql_error()); $_SESSION['indexsearch_result'] = array(); while($row = mysql_fetch_array($result)){ $_SESSION['indexsearch_result'] = $row; } } else { // Save error as string, so we can use it how we wish later. $error = '<center><p><font color ="red">Team Name contains either; one or more invalid characters, or too many/too little characters.</font></p></center>'; } } if(!isset($_SESSION['indexsearch_result']) || $error != null){ // No Search or errors echo(($error != null)? $error : ""); }else{ echo(' <table width="600" height="100" border="0" /> <thead> <tr> <th scope="col">Team Name</th> <th scope="col">Fixture List URL</th> </tr> </thead>'); echo(' <tbody> <tr> <td>'.$_SESSION['indexsearch_result']['team_name'].'</td> <td><a target="_blank" href="'.$_SESSION['indexsearch_result']['url'].'> Fixtures</a></td> </tr> </tbody> </table>'); // End echoing result. } ?> </div> <?php // Include the HTML footer. include ('./includes/footer.html'); ?>
-
Oh sure, sorry its late and im not with it. It has shown the same errors and its still very long so i wouldn't know where to start looking. Anyway i have added it here for you to see. (just a small portion because apparently max characters is 40000) <td><a target="_blank" href="http://news.bbc.co.uk/sport1/hi/football/teams/a/accrington_stanley/fixtures/default.stm>Fixtures</a></td> </tr> </tbody> </table>array(24) { ["GLOBALS"]=> &array(24) { ["GLOBALS"]=> &array(24) { ["GLOBALS"]=> *RECURSION* ["_ENV"]=> array(32) { ["CONTENT_LENGTH"]=> string(2) "42" ["CONTENT_TYPE"]=> string(33) "application/x-www-form-urlencoded" ["DOCUMENT_ROOT"]=> string(26) "/home/footba33/public_html" ["GATEWAY_INTERFACE"]=> string(7) "CGI/1.1" ["HTTP_ACCEPT"]=> string(63) "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" ["HTTP_ACCEPT_CHARSET"]=> string(30) "ISO-8859-1,utf-8;q=0.7,*;q=0.7" ["HTTP_ACCEPT_ENCODING"]=> string(12) "gzip,deflate" ["HTTP_ACCEPT_LANGUAGE"]=> string(14) "en-gb,en;q=0.5" ["HTTP_CACHE_CONTROL"]=> string(9) "max-age=0" ["HTTP_CONNECTION"]=> string(10) "keep-alive" ["HTTP_COOKIE"]=> string(233) "phpbb3_nfhiu_u=1; phpbb3_nfhiu_k=; phpbb3_nfhiu_sid=dc050c7e193dc87bb89825ee898f9781; style_cookie=null; phpbb3_7rsoy_k=; phpbb3_7rsoy_u=2; phpbb3_7rsoy_sid=2fe48d284c54fe446ebe9c196824625c; PHPSESSID=8e49aa1d1cbc3bb131689acd465d7a3f" ["HTTP_HOST"]=> string(20) "www.footballtrip.net" ["HTTP_KEEP_ALIVE"]=> string(3) "115" ["HTTP_REFERER"]=> string(40) "http://www.footballtrip.net/fixtures.php" ["HTTP_USER_AGENT"]=> string(88) "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3" ["PATH"]=> string(13) "/bin:/usr/bin" ["QUERY_STRING"]=> string(0) "" ["REDIRECT_STATUS"]=> string(3) "200" ["REMOTE_ADDR"]=> string(14) "90.212.231.148" ["REMOTE_PORT"]=> string(5) "52045" ["REQUEST_METHOD"]=> string(4) "POST" ["REQUEST_URI"]=> string(13) "/fixtures.php" ["SCRIPT_FILENAME"]=> string(39) "/home/footba33/public_html/fixtures.php" ["SCRIPT_NAME"]=> string(13) "/fixtures.php" ["SERVER_ADDR"]=> string(12) "69.175.67.90" ["SERVER_ADMIN"]=> string(26) "[email protected]" ["SERVER_NAME"]=> string(20) "www.footballtrip.net" ["SERVER_PORT"]=> string(2) "80" ["SERVER_PROTOCOL"]=> string( "HTTP/1.1" ["SERVER_SIGNATURE"]=> string(0) "" ["SERVER_SOFTWARE"]=> string(6) "Apache" ["UNIQUE_ID"]=> string(24) "TA2o2UWvQ1oAACsUeKkAAAAH" } ["HTTP_ENV_VARS"]=> array(32) { ["CONTENT_LENGTH"]=> string(2) "42" ["CONTENT_TYPE"]=> string(33) "application/x-www-form-urlencoded" ["DOCUMENT_ROOT"]=> string(26) "/home/footba33/public_html" ["GATEWAY_INTERFACE"]=> string(7) "CGI/1.1" ["HTTP_ACCEPT"]=> string(63) "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" ["HTTP_ACCEPT_CHARSET"]=> string(30) "ISO-8859-1,utf-8;q=0.7,*;q=0.7" ["HTTP_ACCEPT_ENCODING"]=> string(12) "gzip,deflate" ["HTTP_ACCEPT_LANGUAGE"]=> string(14) "en-gb,en;q=0.5" ["HTTP_CACHE_CONTROL"]=> string(9) "max-age=0" ["HTTP_CONNECTION"]=> string(10) "keep-alive" ["HTTP_COOKIE"]=> string(233) "phpbb3_nfhiu_u=1; phpbb3_nfhiu_k=; phpbb3_nfhiu_sid=dc050c7e193dc87bb89825ee898f9781; style_cookie=null; phpbb3_7rsoy_k=; phpbb3_7rsoy_u=2; phpbb3_7rsoy_sid=2fe48d284c54fe446ebe9c196824625c; PHPSESSID=8e49aa1d1cbc3bb131689acd465d7a3f" ["HTTP_HOST"]=> string(20) "www.footballtrip.net" ["HTTP_KEEP_ALIVE"]=> string(3) "115" ["HTTP_REFERER"]=> string(40) "http://www.footballtrip.net/fixtures.php" ["HTTP_USER_AGENT"]=> string(88) "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3" ["PATH"]=> string(13) "/bin:/usr/bin" ["QUERY_STRING"]=> string(0) "" ["REDIRECT_STATUS"]=> string(3) "200" ["REMOTE_ADDR"]=> string(14) "90.212.231.148" ["REMOTE_PORT"]=> string(5) "52045" ["REQUEST_METHOD"]=> string(4) "POST" ["REQUEST_URI"]=> string(13) "/fixtures.php" ["SCRIPT_FILENAME"]=> string(39) "/home/footba33/public_html/fixtures.php" ["SCRIPT_NAME"]=> string(13) "/fixtures.php" ["SERVER_ADDR"]=> string(12) "69.175.67.90"
-
Ok i added that at the bottom and have been returned 9 pages of HTML with no spaces so its kind of hard to read or understand. It seems to be giving a response for all the information stored in MySQL database. None of my other pages are doing this so i have no idea why this is acting the way it is.
-
Yes it does mate! Where do i go from here?
-
Hi, I have a working table that produces the info that i require however after adding it to the page what ever i try and add after it seems to make the PHP result vanish aswell as not showing the div i had tried adding. I have got a feeling it is something to do with the PHP i added and not set up properly because when this table is removed i can add divs and information like normal. Any help would be much appreciated. Thanks <?php $error = null; if(isset($_POST['submit'])){ // Search form // Do the search query here first: require_once ('../mysql_connect.php'); // Santize Post code and team supported. (Santitize both, never use trim or other similar functions when santizing input.) if ( mysql_real_escape_string( $_POST['team_name']) ) { // Select every column from the table where conditions match: $query = "SELECT * FROM teams WHERE team_name LIKE '%" . $_POST['team_name'] . "%'"; $result = mysql_query($query) or trigger_error("Query: $query\n<br />MySQL Error: ".mysql_error()); $_SESSION['indexsearch_result'] = array(); while($row = mysql_fetch_array($result)){ $_SESSION['indexsearch_result'] = $row; } } else { // Save error as string, so we can use it how we wish later. $error = '<center><p><font color ="red">Team Name contains either; one or more invalid characters, or too many/too little characters.</font></p></center>'; } } if(!isset($_SESSION['indexsearch_result']) || $error != null){ // No Search or errors echo(($error != null)? $error : ""); }else{ echo(' <table width="600" height="100" border="0" /> <thead> <tr> <th scope="col">Team Name</th> <th scope="col">Fixture List URL</th> </tr> </thead>'); echo(' <tbody> <tr> <td>'.$_SESSION['indexsearch_result']['team_name'].'</td> <td><a target="_blank" href="'.$_SESSION['indexsearch_result']['url'].'>Fixtures</a></td> </tr> </tbody> </table>'); // End echoing result. } ?>
-
Thanks again Ignace works a treat!
-
Hey, I have been playing around with a count function and have it nearly working how i want it to but cant figure out what is going wrong. The code is returning these results: There are 11 11 supporters. There are 9 9 supporters. There are 2 2 supporters. There are 2 2 supporters. There are 1 1 supporters. There are 1 1 supporters. The second number(s) should be the names of teams but i can't seem to get the names to show. The reason for this is because of the duplication of . $row['team_supported'] ." but if i have it like . $row['COUNT(team_supported)'] ." i get an error of undefined variable. Anyway here is what i have done so far. <?php $query = "SELECT team_supported, COUNT(team_supported) AS team_supported FROM users GROUP BY team_supported ORDER BY team_supported DESC LIMIT 6"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo "There are ". $row['team_supported'] ." ". $row['team_supported'] ." supporters."; echo "<br />"; } ?>
-
Hi, I'm not sure if this can be done but can you use php to search your MySQL database and read entries to count and display the most popular of a certain item. For example.. when you register you have a mutliple choice of post codes. Can you then read the database to find the five most popular post codes and display them in a table. Thanks for any advice.
-
Thanks for all the info! It's all working fine, its good to see the different ways you could have done this. Smee
-
Ok, Ignace i changed the section u mentioned but got the following error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in ***/index.php on line 88 line 88 is: <td>' . $row['first_name'] . '</td> I then changed both " to ' like it was before but kept your \'s on $row_color and no errors but no alternate colors. There was me thinking this would be an easy job. <?php require_once ('../mysql_connect.php'); echo ('<table width="294" height="150" border="0" /> <thead> <tr> <th scope="col">First Name</th> <th scope="col">Post Code</th> <th scope="col">Team Supported</th> </tr> </thead> '); $color0 = "#FFF"; $color1 = "#CCC"; $row_count = 0; $result = mysql_query("SELECT first_name, post_code, team_supported FROM users ORDER BY user_id DESC LIMIT 5") or die (mysql_error()); while($row = mysql_fetch_assoc($result)) { if ($row_count == 1) { $row_color = $color1; $row_count = 0; } else { $row_color = $color0; $row_count++; } echo ('<tbody> <tr bgcolor=\"$row_color\"> <td>' . $row['first_name'] . '</td> <td>' . $row['post_code'] . '</td> <td>' . $row['team_supported'] . '</td> </tr> </tbody>'); } echo "</table>"; ?>
-
Thanks your method seems like it should work perfectly. I implemented it to my script and still do no get alternate colors, It still gives the right MySQL results just no color. It wouldn't be anything to do with CSS that needs adding as well, i mean i tried earlier with the CSS method and that didn't work either. Well anyway here is the new code thanks to JD307. <?php require_once ('../mysql_connect.php'); echo ('<table width="294" height="150" border="0" /> <thead> <tr> <th scope="col">First Name</th> <th scope="col">Post Code</th> <th scope="col">Team Supported</th> </tr> </thead> '); $result = mysql_query("SELECT first_name, post_code, team_supported FROM users ORDER BY user_id DESC LIMIT 5") or die (mysql_error()); $color0 = '#FFF'; $color1 = '#CCC'; $row_count = 0; while($row = mysql_fetch_assoc($result)) { if ($row_count == 1) { $row_color = $color1; $row_count = 0; } else { $row_color = $color0; $row_count++; } echo ('<tbody> <tr bgcolor="$row_color"> <td>' . $row['first_name'] . '</td> <td>' . $row['post_code'] . '</td> <td>' . $row['team_supported'] . '</td> </tr> </tbody>'); } echo "</table>"; ?>
-
Thanks for the help mate, What i thought should be happening is by using this code: $row_color = ($row_count % 2) ? $color1 : $color2; And having specified the colors in previous varials (color1 and color2) it will take what color is needed a placed in the bgcolor ="$row_color" section like below? <td bgcolor="$row_color">' . $row['first_name'] . '</td> I could be so far of the right method of doing this so my bad if its all a bit messed up heh Smee
-
Hi, I posted an earlier article on the CSS forum section but have come to realise the problem is not CSS related and the solution was through PHP so i have given it a go and still seem to have no alternate colors. Can anyone see where i am going wrong with the following code: <?php require_once ('../mysql_connect.php'); echo ('<table width="294" height="150" border="0" /> <thead> <tr> <th scope="col">First Name</th> <th scope="col">Post Code</th> <th scope="col">Team Supported</th> </tr> </thead> '); $color1 = "#FFF"; $color2 = "#CCC"; $row_count = 0; $result = mysql_query("SELECT first_name, post_code, team_supported FROM users ORDER BY user_id DESC LIMIT 5") or die (mysql_error()); while($row = mysql_fetch_assoc($result)) { $row_color = ($row_count % 2) ? $color1 : $color2; echo (' <tbody> <tr> <td bgcolor="$row_color">' . $row['first_name'] . '</td> <td bgcolor="$row_color">' . $row['post_code'] . '</td> <td bgcolor="$row_color">' . $row['team_supported'] . '</td> </tr> </tbody> '); $row_count++; } echo "</table>"; ?>