Jump to content

ElyTTL

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ElyTTL's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. *bump* please help if you can
  2. Thank you, the code i have is this: [code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled</title> </head> <body> <? $date = $_REQUEST["date"]; $div = $_REQUEST["div"]; $teama = $_REQUEST["teama"]; $teamapts = $_REQUEST["teamapts"]; $teamb = $_REQUEST["teamb"]; $teambpts = $_REQUEST["teambpts"]; $con = mysql_connect("localhost","elyttl","PASSSWORD"); if (!$con)   {   die('Could not connect: ' . mysql_error());   } mysql_select_db("elyttl_2168", $con); mysql_query("INSERT INTO tbl_latres (Date, Divsion, TeamA, TeamA_pts, TeamB, TeamB_pts) VALUES ('$date', '$div', '$teama', '$teamapts', '$teamb', '$teambpts' )"); echo $date . " " . $div . " " . $teama . " " . $teamapts . " " . $teamb . " ". $teambpts; mysql_close($con); $con = mysql_connect("localhost","elyttl","PASSWORD"); if (!$con)   {   die('Could not connect: ' . mysql_error());   } mysql_select_db("elyttl_2168", $con); if $div ==1; $query="SELECT * FROM tbl_div1 WHERE TeamName = $teama"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); echo "<b><center>Database Output</center></b><br><br>"; $i=0; while ($i < $num) { $Played=mysql_result($result,$i,"Played"); $Won=mysql_result($result,$i,"Won"); $Drawn=mysql_result($result,$i,"Drawn"); $Lost=mysql_result($result,$i,"Lost"); $G_for=mysql_result($result,$i,"G_for"); $G_asgt=mysql_result($result,$i,"G_asgt"); $Points=mysql_result($result,$i,"Points"); $i++; } $Played = $Played + 1 if ($teamapts > 5) $Won = $Won + 1; elseif ($teamapts == 5) $Drawn = $Drawn + 1; Else $Lost = $Lost + 1;   $G_for = $G_for + $teamapts $G_agst = $G_agst + $teambpts $Points = $Points + $teamapts mysql_query("UPDATE tbl_div1 SET Played = '$Played', SET Won = '$Won', SET Drawn = '$Drawn', SET Lost = '$Lost', SET G_for = '$G_for', SET G_agst = '$G_agst', SET Points = '$Points' WHERE TeamName = '$teama'"); else ?> </body>/[/code] the top part works however the bottom part doesn't, it will probally look like it was written by a complete NooB as it has, but you can only learn, i think that it probally all wrong [b]EDITED BY WILDTEEN88: PLEASE USE CODE TAGS ([nobbc][CODE][/CODE][/nobbc]) WHEN POSTING CODE[/B]
  3. Hi, i need to know the best/simplest way to update a results table using to the lastest results just posted, such as get the teamA and teamA's points to update the following coloums: [list] [*]Played [*]Won [*]Drawn [*]Lost [*]Games For [*]Games Against [/list] The Results will be published useing the games for such as 0 - 10 then if the points are 6 or higher then this is a win and 5 is a draw and then less than 5 is a loss. Any help will be welcomed with many thanks. Ben
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.