I tried to run "php ./calculate_paths_to_victory.php" from the CLI and I'm getting a MYSQL error:
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 'group by b.id' at line 1
Are you running it from the right directory? I don't know if this matters. Just guessing.
Yea, from admin/
I'm assuming this is the query it's talking about:
$query = "SELECT b.id, b.name, count(*) c FROM `brackets` b,`possible_scores` p where p.bracket_id = b.id and p.rank <= " . $maxrank . " group by b.id";
Also, here's the version of mysql I'm running: mysql -version
mysql Ver 14.14 Distrib 5.1.49, for debian-linux-gnu (x86_64) using readline 6.1
Do all your brackets have valid IDs?
It appears so, sequential numbers.
Have you guys tested it? I'm curious if it's just me or if others are having the same problem. Also, what version of MySQL are you running?
I have two instances of it running and I haven't experienced that error. I'm running mysql Ver 14.12 Distrib 5.0.91.
I wonder if it could be related to special characters in bracket names.
Besides A-Z 0-9, my bracket names have:
I'm on 5.0.45 with no issues.
I had it fwrite the query to STDOUT, and apparently the $maxrank variable isn't getting set? Here's the output:
SELECT b.id, b.name, count(*) c FROM `brackets` b,`possible_scores` p where p.bracket_id = b.id and p.rank <= group by b.id
So p.rank has no value being set. I'm a novice with php at best, so any advice on how/where p.rank is supposed to get set or any other advice is greatly appreciated.
Also, I added some debugging to see what #maxScoreRanks is, as shown below:
for( $scoreRank=1; $scoreRank <= $maxScoreRanks; $scoreRank++ )
updateProbabilities( $roundMap, $seedMap, $childGraph, $scoring, $master_data, $scoreRank, $db );
// Also, do last place calc...
updateProbabilities( $roundMap, $seedMap, $childGraph, $scoring, $master_data, $numBrackets, $db );
fwrite(STDOUT, "Score rank: $maxScoreRanks \n");
But it appears #maxScoreRanks doesn't have a value assigned to it… thoughts?
Something between last year's version of this and this year's version of this has broke this… I've narrowed it down to these diffs: http://tourney.svn.sourceforge.net/viewvc/tourney/trunk/admin/calculate_paths_to_victory.php?r1=69&r2=85
Check your admin/database.php file. It is probably out of date.
$maxScoreRanks is set in that file.
admin/database.php is not under source control. admin/database.php.tmp is under source control.
When you update your source, you need to manually copy and rename database.php.tmpl to database.php and reenter your authentication information.
That did it, thanks!
Log in to post a comment.