
Aeolus
Members-
Posts
36 -
Joined
-
Last visited
Never
Everything posted by Aeolus
-
Hello, I'm wondering if anyone has any help on how to quickly put show/class results into a database. I'd love to be able to just copy and paste the entire entry list, generate placings and scores, and have the same form plug it all into a database. So you have a textarea form where I can put in Class Name - User Name Class Name - User Name and get out... Class Name - User Name - Score - Placing Class Name - User Name - Score - Placing That's the basics, and I can add in other details later on. If no one knows how to do the score/placing I believe I can get that figured out if anyone can point me in the right direction for getting the results randomized and plugged in from the text area... Has anyone done this, know of any tutorials that would help, or at least just advice of where to start? Thank you!
-
What sites can I go to to learn advanced web programming?
Aeolus replied to optikalefx's topic in Miscellaneous
lynda.com rocks -
Is this a recognized character type? Try formatting it after it comes out of the database instead of before it goes in - see how that works for you.
-
Display db data in drop down; insert selection into new table?
Aeolus replied to eanderson's topic in PHP Coding Help
I think you have the right idea here - use instructor_id on the classes table. Later on, you can always use a simple mysql join query to get the instructor's information where instructor_id=instructor_id ... Does that make sense? -
No, that's what I'm questioning. I'll play around with it and update this posting this afternoon with what I find - for now I have to go feed horses!
-
Now it's returning way too many... looks like it's just returning all the rows off the points table... maybe I should try this a different way.. :/ $rowi = mysql_fetch_array($result); foreach ($rowi as &$row) {
-
Should I just replace my while with foreach? That returns an error unexpected ')'
-
But right now my mind is a blank slate. Anyone want to jumpstart my battery? $result = @mysql_query("SELECT * FROM e_result WHERE EXISTS ( SELECT `points` FROM e_pointscale WHERE e_pointscale.c_group=$c_group AND e_pointscale.place = e_result.rank ) and c_id=$c_id ORDER BY rank"); if( !$result ) { trigger_error( "Failed Connection: " . mysql_error() ); } while ($row = mysql_fetch_array($result)) { echo '<tr> <td><b> ' . $row ['name'] . '</b></td> <td>'; printf("%04.1f", $row ['d_score']); echo '</td> <td>'; printf("%04.1f", $row ['c_score']); echo '</td> <td>'; printf("%02.0f", $row ['j_score']); echo '</td> <td>'; echo $row ['score'] . '</td> <td>'; echo $row ['count'] . '</td> <td> ' . $row ['rank'] . ' </td> <td>'; echo $row ['points'] . '</td></tr>'; }; it's only returning one row, instead of looping to repeat for each row found. I know it's a simple fix, I'm doing something wrong with requesting my information (trying to get points from points table for each row on the e_results table).
-
Why couldn't you consider the "services" as products, and go from there?
-
I am going to try making a point_scale table and getting the information from there... I'm sure there's a more efficient way of doing this, but this page also won't see a lot of traffic and won't be accessible to most people on the site, so it shouldn't be an issue at least until I can find a better way to do this.
-
I'm trying to build a points table of sorts... Let me see if I can get it on here Top row represents # of entrants, left column represents rank 12345... 1st12345... 2nd01234... etc... so that each time another entrant is there, the points go up. I wouldn't mind if they only went up in increments of 5 (so for every five entrants, points went up) and I only want up to 10th place player to be awarded points. Does that help?
-
Any suggestions?
-
:-\ Kind of a strange title, but here's what I'm trying to do. I assume I'll need an array, which I am very poor at, so... I have a table (competition results), which holds competition id competion level username user's scores rank (calculated and stored based off scores) points (currently empty) count of users in the competition >> I may drop this if it's more efficient to obtain and count these when I'm calculating points instead of off on it's own, it's only there for point counting and a simple echo. What I'd like is to calculate points based off of the level of the event, the player's placing, and the number of players entered in the event. I'd like to insert the points earned into the event result table for future reference and counting. Any suggestions?
-
Does anyone have any suggestions?
-
I would really like to count this > I'd like to know how many rows are returning with matching c_id, basically, how many rows am I selecting here.. Version 5.0.51b INSERT INTO `e_result` ( `c_id`, `name`, `d_score`, `c_score`, `j_score`, `score`, `rank` ) SELECT $c_id, a.`name`, a.`d_score`, a.`c_score`, a.`j_score`, a.`score`, @MYCOUNTER:= @MYCOUNTER + 1 AS `rank` FROM ( SELECT `name`, @DVAR:=(`nat_d` + `tra_d` + FLOOR( {$natModifierMin} + RAND() * ({$natModifierMax} - {$natModifierMin}))) AS `d_score`, @CVAR:=(`nat_c` + `tra_c` + FLOOR( {$natModifierMin} + RAND() * ({$natModifierMax} - {$natModifierMin}))) AS `c_score`, @JVAR:=(`nat_j` + `tra_j` + FLOOR( {$natModifierMin} + RAND() * ({$natModifierMax} - {$natModifierMin}))) AS `j_score`, @DVAR + @CVAR + @JVAR AS `score` FROM `horses` WHERE `c_id`=$c_id ) AS `a` WHERE 1=1 ORDER BY a.`score`
-
This part worked @DVAR:=(`nat_d` + FLOOR( {$natModifierMin} + RAND() * ({$natModifierMax} - {$natModifierMin}))) AS `d_score`, @CVAR:=(`nat_c` + FLOOR( {$natModifierMin} + RAND() * ({$natModifierMax} - {$natModifierMin}))) AS `c_score`, @JVAR:=(`nat_j` + FLOOR( {$natModifierMin} + RAND() * ({$natModifierMax} - {$natModifierMin}))) AS `j_score`, @DVAR + @CVAR + @JVAR AS `score`
-
`nat_d` + FLOOR( {$natModifierMin} + RAND() * ({$natModifierMax} - {$natModifierMin})) AS `d_score`, `nat_c` + FLOOR( {$natModifierMin} + RAND() * ({$natModifierMax} - {$natModifierMin})) AS `c_score`, `nat_j` + FLOOR( {$natModifierMin} + RAND() * ({$natModifierMax} - {$natModifierMin})) AS `j_score`, `d_score` + `c_score` + `j_score` AS `score` this is what I'm trying to do... but it's not working.. :/ The first three rows work fine but the last doesn't...
-
Lol.. so I suck I had varchar instead of integer on the score - no idea why... part of me had to be difficult I suppose. Voila! It seems to be working! woo hoo, thank you sooo much for your help!
-
I won't need to know what the randomized numbers are, but I'm still getting 2e+0 3e+0 4e+0 as "score" on the event table... the ranking seems to be working now
-
I'm getting these values in my event table.. rank score user Test 3e+0 1 Test 3e+0 2 Test 3e+0 3 >> I'll try again, to double check >> getting the same thing :/
-
I see where you're coming from, and I didn't plan on having the $score_d = $row ['nat_d'] + 4; $score_j = $row ['nat_j'] + 4; $score_c = $row ['nat_c'] + 4; in there twice once I figured out where it actually needed to be - I was just trying things back and forth trying to figure this out and left it in there again. And how should I go about the second mysql query. Sorry, I'm an obvious beginner at php and I'm trying to learn bit by bit, so every piece of advice is appreciated.
-
I'm sure there's a more efficient way to do this, but maybe you could do a set of if statements (if field1 is blank echo all but field1).. if I'm understanding you correctly.. ?