Jump to content

Luvac Zantor

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Luvac Zantor's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Let me clarify. I have a database that keeps track of football stats based on the weekly games. What ends up happening is that each player ends up with multiple entries based on the week they played. What I want to do is take all those entries, and create an output that adds all the stats. (ie. yards for week 1 and week 2 and week 3, etc..) I was wanting to avoid having to create ANOTHER table to store things in (seemed redundant, since I figure there must be a way to pull multiple rows and \"add\" them together) I\'ve been looking around for a few hours, but must be looking in the wrong place. (online and the PHP Bible). Suggestions? thanks!
  2. btw,,, in the text file, it doesn\'t WRAP like it is in the above example.... PASSING CMP ATT YDS PCT Kurt Warner 13 24 177 54 RUSHING ATT YDS AVG Garrison Hearst 34 138 4.0 Robert Holcombe 2 21 10.5 Kurt Warner 1 -2 -2.0 i shortened it so it doesn\'t wrap... but regardless, the importing is confusing me.
  3. Example: PASSING CMP ATT YDS PCT YPA SACK TD INT LONG RATING Kurt Warner 13 24 177 54 7.3 0 1 2 42 57.1 RUSHING ATT YDS AVG LONG TD FUM Garrison Hearst 34 138 4.0 21 1 1 Robert Holcombe 2 21 10.5 15 0 0 Kurt Warner 1 -2 -2.0 0 0 0 How do you import a file that isn\'t formated the same through out the file. The above is part of an entire file with multple headings, and I can\'t for the life of me figure out how to import the file. Suggestions?
  4. number_format($result[Pct],0) ah ha!!! nevermind
  5. Yeah i\'m looking now, but I figured If anyone browsing knew,,,, i\'d ask.
  6. dang you were quick to respond.... I just guessed at using the fetch_array, which apparently is what you replied with. again, thanks for the help!!!!!
  7. got it... I modified what you had slightly and it\'s working now $connection = mysql_select_db($database, $server); $sql = \'SELECT * FROM PASSING ORDER BY PASSING.Yds DESC LIMIT 0, 3 \'; $query = mysql_query($sql); $i = 0; while ($i < mysql_num_rows($query)) { $result = mysql_fetch_array($query); echo "Player is " . $result[Player] . "<BR>"; echo "Players yards are " . $result[Yds] . "<BR>"; $i++; } some changes probably not needed, but changed the internal num_row to fetch_array and it\'s doing what it should! THANKS FOR THE INSIGHT, it utterly helped me fix the problem. THANKS!!!
  8. the page is displaying multiple lines with NO stats showing.
  9. trying that now. I agree that it should work, you\'d think, but if my query is multiple lines,, doesn\'t work. I put it in one line, it works *Shrugs* Also the query works in phpmyadmin, which is why I was initially confused. btw, thanks for the help!!!
  10. ok, how do I query the \"next\" row in an array? I tried mysql_fetch_row() but it failed....
  11. got it, my query has to be one line. I just put all the query info into ONE line, and it appears to be working now.
  12. looks like my query is wrong.. too many lines maybe? regardless it works now as this.... $server = mysql_connect($host, $username, $password) or die(mysql_error()); $connection = mysql_select_db($database, $server); $sql = \'SELECT * FROM PASSING\'; $query = mysql_query($sql); $result = mysql_fetch_array($query); echo "Player is " . $result[Player] . "<BR>"; echo "Players yards are " . $result[Yds] . "<BR>"; It displays now, but how do I get it to display just the top 3 in yards?
  13. btw, if I use a query analizer..... the query DOES return information, so it\'s there....
×
×
  • 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.