Ladder
Posted: Mon Jan 28, 2008 6:44 pm
Hi, I am a new to this forum, and I want to know how to make a ladder.
Let me explain,
I am making a website for a gaming clan: http://warfaringwarriors.x10hosting.com
And I tought of making a ladder. Every saturday, there is gunna be a match and the players partipating in the match will receive points.
Here is what I can do:
- THe registration page
-Create the table and display it by points:
Input page(after the registration from the HTML form has been sent):
Here is what I need help with:
-Update the points, which I tried and failed miserably....
Thanks for your help, If you need more details please dont hesitate to ask me
Good day!
Edit: I forgot to mention, when I say Update the points which means: for exemple Player X plays 5 games and he has 100 poitns till now, and he gets 10 poitns for game 6. Well When I will update it , It shud do: 100+10... I have an idea, I think in the outpage i shud put a textbox near the names/points thing, andthere the officers can put the points he got. At the bottom there is a submit button, when they click, it sends to another page. Where there is a function thats adds up the funtion and saves the result i nthe DB. But how to do it, I can't figure it out...!!!
Let me explain,
I am making a website for a gaming clan: http://warfaringwarriors.x10hosting.com
And I tought of making a ladder. Every saturday, there is gunna be a match and the players partipating in the match will receive points.
Here is what I can do:
- THe registration page
-Create the table and display it by points:
Input page(after the registration from the HTML form has been sent):
Output Page:<?php
$points= addslashes($points);
$eso = addslashes ($eso);
$email = addslashes ($email);
$country = addslashes ($country);
@ $link = mysql_pconnect ("localhost", "user", "pass");
if (!$link)
{
echo "Error: Can't connect right now. Please try again later.";
exit;
}
mysql_select_db("database");
$query = "insert into clanapp values
('".$points."', '".$eso."', '".$email."','".$country."')";
$result = mysql_query($query);
if ($result)
mail( "officers@warfaringwarriors.x10hosting.com ", "New application for the Warfaring Warriors Training Camp Tournament",
"eso: $eso","</br>","email: $email","</br>","country: $country","</br>", "From: $email" );
echo "Application inserted into database. <a href='index.php'>Go Back.</a>";
?>
Will this work?<?php
$link = mysql_connect ("localhost", "user", "pass");
mysql_select_db ("database", $link);
$result = mysql_query("SELECT * FROM database", $link);
if (mysql_db_query("batabase", "select * from table", $link))
{
print ("");
}
else
{
print ("The query could not be executed!<BR>");
}
$link = mysql_connect ("localhost", "user", "pass");
mysql_select_db("database",$link);
$Result = mysql_query("SELECT * FROM table ORDER BY 'points'",$link);
echo "<table cellpadding='0' width='400'>";
echo "<tr bgcolor='#eeeeee'>";
echo "<th>Points</th><th>ESO Username</th><th>e-mail</th><th>country</th>";
echo "</tr>";
while ($Row = mysql_fetch_row($Result))
{
printf ("<tr><td align='center'>%s</td><td align='center'>%s</td><td align='center'>%s</td><td align='center'>%s</td></tr>",
$Row[0], $Row[1], $Row[2], $Row[3] );
}
echo "</table>";
?>
Here is what I need help with:
-Update the points, which I tried and failed miserably....
Thanks for your help, If you need more details please dont hesitate to ask me
Good day!
Edit: I forgot to mention, when I say Update the points which means: for exemple Player X plays 5 games and he has 100 poitns till now, and he gets 10 poitns for game 6. Well When I will update it , It shud do: 100+10... I have an idea, I think in the outpage i shud put a textbox near the names/points thing, andthere the officers can put the points he got. At the bottom there is a submit button, when they click, it sends to another page. Where there is a function thats adds up the funtion and saves the result i nthe DB. But how to do it, I can't figure it out...!!!