Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
I'm using jEdit, we tried setting up Eclipse and Netbeans in the past and could not get either to work with connecting to the repositories. I personally don't like a huge IDE with a ton of features, I'm used to Textpad. I like syntax highlighting and auto indent - meaning when I type if(){ it indents the next line. But I've never seen one that can take a non-indented file and fix it. I checked jEdit and can't find it, even as a plugin.
-
I know there's probably more than one tool that can do it for me, but by the time I was a quarter done I decided it would take longer to install those tools. For next time though definitely.
-
I just went through a 700 line tpl line by line adding indentation. It had none. Gee, I wonder why the previous developer couldn't find his bugs? :'( :'( It took me 45 minutes to figure out where the loop was that he was messing up. So yes, I'm grumpy today.
-
*Like*
-
*shrug*. I know it's POSSIBLE. I don't know how to do it. Anyway the main idea I wanted to communicate is that you shouldn't be doing separate queries for each player. If doing it in one query is too much, then it's better to just go ahead and select all the scores for everyone, and do the math in PHP like you're trying to do. $scores = array(); //SQL here to select all while([...]){ if(count($scores[$playerID]) < 12){ $scores[$playerID][] = $score; } } $totals = array(); foreach($scores AS $player => $player_scores){ $totals[$player] = array_sum($player_scores); } Not tested, just an example.
-
Needs the top 12 scores only to be summed. I think this article might help. http://www.xaprb.com/blog/2006/12/07/how-to-select-the-firstleastmax-row-per-group-in-sql/ Other help: http://stackoverflow.com/questions/2129693/mysql-using-limit-within-group-by-to-get-n-results-per-group
-
See my edit: It's possible to do it in one statement. If you ask on the SQL board, they'll tell you - never run queries in loops. It's just bad.
-
You can actually join a table to itself, but now that you've said what you're trying to do, the first part is useless. You can get rid of the first query and just do $query2 = "SELECT playername, nationalpoints FROM `tournamentresults` WHERE `date` >= '2012-01-01' ORDER BY `nationalpoints` DESC LIMIT 12"; Then loop through that to get the info. edit: Actually you could do the whole action in one SQL statement. Because you want to limit it to the first 12 results it's a little harder. Are you able to export your data?
-
Headphones. Preferably noise cancelling.
-
I care. Really.
-
Yeah, those should be two separate .tpls. Have your PHP file with basically the same logic, but determine which .tpl to use.
-
Creating Simple Cart/ Submitting Seperate Forms at once
Jessica replied to frshjb373's topic in PHP Coding Help
As it is, you should be using a database now. If you want to add more functionality yes you should definitely use a database to manage your data. -
So you found this forum but still want to know what languages to learn? There's an application design board for ... well, application design. Which is more what you're asking. This board is for help with actual code. Not "What languages should I learn". Which - dude. You're on a forum called PHP freaks. We're not going to say "go learn .net" Edit: I'm 99% sure this was originally in PHP Coding. Now that it's been moved I get to look like a bitch but whatever. Asking what language you should learn on a PHP site is still annoying.
-
It wasn't sarcasm. You're doing a select query within a loop. You need to use a JOIN instead of running a query in a loop. And restructure the code once that's done.
-
The biggest problem here is you need to learn how to do a JOIN - then we can fix the rest of the code.
-
It's amazing you learned all you have without ever hearing about google. Or how to read the rules on a forum. This board is for help with code, not finding resources.
-
Common..Jessie....don't kidding me To write integers between 1 - 12, this guy use integer column type(10), signed. @Christian, could you explain to him, what does mean, please ? Look at the freaking math OP is doing, and if you're going to try to use my name instead of my username, spell it right, it's RIGHT THERE.
-
In his structure months is a number of months, not the 10th month.
-
Well, my main purpose is to try to do the following: -Have a user enter a secret number -Encrypt this number into the database -Use this number as another security measure for changing passwords (as in, you must enter YOUR secret number to be able to change your password) So, I'm trying to figure out how to have something encrypted into a database, from which later, I can draw information from to cross-reference what the user has inputted to say whether or not the user's input is matching or not. You hash the password AND the PIN. Then when the user tries to do something that requires both password and PIN, you hash the given values. If the hashes match, it's valid. You never need to decrypt the values.
-
How about entertaining the poor driver? We like driving. We fight over who gets to drive more on those trips.
-
What do you do as a passenger in the car without playing on your phone?!?! I always thought it was funny that they don't announce the mountain time. I will say for a while my mom thought there were only 3 timezones in the US, which made it hard when I was in LA and she tried to plan when she would call me from the east coast. She thought it was 2 hours difference.
-
Shouldn't that make it obvious? I mean, when we travel from Dallas to LA or Dallas to NoVa, I love watching the cell phone jump back or forward an hour. Shouldn't that make an average person go "oh hey, we're in a different timezone."
-
See how all of your other form elements have a name="name goes here"? You need one on submit. Preferably it should be submit since that's what you're testing for. if($_POST['submit'])
-
That is one of the problems with the script, the biggest one. OP: Enable error reporting. And use code tags here.