-
Help...
Well basically on our sporting website, I am looking to add a thing on the front page where it shows someones name and how many goals they've scored...
I've seen them before... an example I want is like this: http://www.brhc.co.uk/ - On their front page they have a "top scorers" thing... I am looking to see if I could have one of these created for me so I could put it on our website?
We have 4 teams at our club, and i'd like one for each team...
Anyone that could create one.. i'm hoping they're simple? would be fantastic.
Thanks.
-
easy system, just create a table, with 4 rows, set the table to have 2 columns, team name and score.
then just add the scores into that, and do the query "select * from `tbl_name` sort desc by score" and then just do mysql_fetch_array for that, and it will just order it out :D simple as.
-
do i do all that coding stuff on the site?
-
Yeh.
If you dont know how to do that, just pm me ingame, and im shure i could sort something out.
-
Cheers for your help mate. +rep.
-
gimi 2 mins, ill just post sql and php code
---------- Post added 23-01-2011 at 08:14 PM ----------
sql : just run this in your sql and it will create the tables needed
Code:
CREATE TABLE IF NOT EXISTS `scores`(
`team` text NOT NULL,
`score` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
-
Cheers for all your help :)
-
The php source:
Code:
<?
$host = "localhost";
$username = "USER";
$password = "PASS";
$database = "DATABASEl";
mysql_connect("$host", "$username", "$password")or die("cannot connect server");
mysql_select_db("$database")or die("cannot select DB");
$sql = mysql_query("SELECT * from `scores`");
echo "<table><tr><td>Team</td><td>Score</td><tr>"
while($r = mysql_fetch_array($sql)) {
echo "<tr><td>."$r['team']."</td><td>".$r['score'];
}
?>
---------- Post added 23-01-2011 at 08:20 PM ----------
should echo all the teams within the database for each row, echo the team name and their score.
just go into the db and edit their scores, or build a script that updates it.
-
Is there a place where I could test this but not on the website? :P
-
just create a php page on the website and dont give anyone the link - should make it a kind of private testing place.