pebcak
-
Posts
9 -
Joined
-
Last visited
Never
Posts posted by pebcak
-
-
Oh crud. I should've been more explicit in my description -- sorry!!
-
Certainly! Here you go!
[attachment deleted by admin]
-
That looks like it just might work! The output I'm getting seems quirky though:
team Wins Losses Orcas Island 0 0 Marysville-Pilchuck 0 3 Shorewood 0 0 Squalicum 0 0 Steilacoom 0 0 Blaine 0 0 Lynden Christian 0 0 Mariner 0 0 Darrington 0 0 Wenatchee 0 0 Anacortes 0 6 Lakewood 0 0 Stanwood 0 0 Liberty Bell 0 1 Everett 0 0 Bishop Blanchet 0 1 Meridian 0 0 La Conner 0 4
It's odd because all teams have only played one game thus far but are showing they've won/loss more than that.
-
at Oldiesmann & Illusion:
I got Oldiesmann code to run. I didn't see the other "mysql_error".
The output is kind of whacky though. I'm using this:
echo $name . " - " . $wins . " - " . $games_lost . "<br>";
and the output is:
Mount Vernon - 0 - 70 Sehome - 0 - 70 Ferndale - 0 - 70 Bellingham - 0 - 70 Nooksack Valley - 0 - 72 Mount Baker - 0 - 72 Ridgefield - 0 - 72 Sedro-Woolley - 0 - 72
All teams have only played one game thus far and the ones showing "0 - 70" are the ones that have won their game. For that last column it looks like it's showing total number of games minus games played + 1 or something. Any thoughts?
------------------------
at roopurt18:
I tried that and got the following error:
"#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table b ON ( a.home_team = b.away_team ) GROUP BY a. `home_team` ORDER BY ' at line 1"
-
I found the problem - closing quote at the end of the mysql_query.
However, now it just says:
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /path/to/file/file.php on line 24
Line 24 is:
$wins = mysql_result($query2, 0, 0) + mysql_result($query2, 0, 1);
-
Any idea on why that error would be happening?
-
Oldiesmann, thanks for the help! I get this error...
"unexpected $end"
-
My client is using a single table to track football scores. It's really odd that he's not using multiple tables but I've been told I am not allow to modify the structure. He wants me to list the teams along with the number of wins/losses, ordered by wins. His table:
game_id |home_team |away_team |home_results |away_results ---------------------------------------------------------------------- 1 |Central |Kickapoo |Win |Loss 2 |Glendale |Hillcrest |Loss |Win 3 |Joplin |Aurora |Loss |Win
Any help would be great!
[SOLVED] Is a query for this even possible?
in MySQL Help
Posted
roopurt18: That works! Thanks!
Barand: Your code results in a "#1109 - Unknown table 'x' in field list". It's probably me though.