Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. I'm seeing you use $pageno everywhere but your links are passing 'pagenum' is there some part of your code that you haven't shown that basically does $pageno = $_GET['pagenum']; ?
  2. Well...I'm not necessarily disagreeing with that, but percentages can be misleading. You can make it look like countryX is doing a better job than countryY because countryX spends 10% of its budget on education, while countryY only spends 3%, by conveniently leaving out the dollar amount of the budgets. For example, countryX could actually be spending 10% per 1 million dollars, while countryY could actually be spending 3% of 1 billion dollars. That puts countryY significantly ahead of countryX in actual dollars spent. But tbh I don't really think it's a lack of money. Other countries start their kids in school younger than us. They expect more out of them. It's a difference in morals, principles, ethics, discipline, value. I don't think lack of money is one of the problems, so much as one of the resulting consequences. In other words, education is not lacking because of lack of money, but rather, money is lacking because of lack of interest in education.
  3. I meant exactly what I said. Studies show that our education standards and grades are far below the rest of the world (not including like 3rd world countries, of course).
  4. Here's my take: <?php // make an array of the lines of the file $list = file('arrayfile.txt'); // for each line of the file... foreach ($list as $val) { // trim the carriage returns off the end of line $val = rtrim($val, "\r\n"); // explode the line at the spaces into an array $row = explode(' ',$val); // first pos in array is the "num:" so remove the : $row[0] = substr($row[0],0,1); // make a loop to loop through each letter of the line // start at 1 because 1st array pos is the num for ($x = 1; $x < count($row); $x++) { // add the current number to the current letter's string $newlist[$row[$x]] .= $row[0] . " "; } // end for } // end foreach // $newlist is not in alphabetical order, because it is created // in order of letter appearance, so let's sort it ksort($newlist); ?> Basically what this does is first read the file into an array, making each line an element of the array. It then removes the carriage returns and the colon and breaks each the current line into another array. First position of that array is the number, all subsequent positions are the letters. Then we loop through each item of the line, starting at the first letter on the line, and ending on the last letter. Inside that for loop, basically what we are doing is producing another array where the letters are the keys and the values of each position is a string of the space separated numbers. We simply concat the current number of the row to the array element with the key named the current letter of the for loop. In other words, the loop does this: 1: A C D 4: A B 5: D F 7: A E 9: B C $newlist['A'] .= "1 "; $newlist['C'] .= "1 "; $newlist['D'] .= "1 "; $newlist['A'] .= "4 "; $newlist['B'] .= "4 "; $newlist['D'] .= "5 "; $newlist['F'] .= "5 "; $newlist['A'] .= "7 "; $newlist['E'] .= "7 "; $newlist['B'] .= "9 "; $newlist['C'] .= "9 "; Since each key of the array is the letters, the order is determined by appearance of the letters, making the resulting order A C D B F E. So throw in a ksort to put the array keys in alphabetical order, and you end up with: Array ( [A] => 1 4 7 [b] => 4 9 [C] => 1 9 [D] => 1 5 [E] => 7 [F] => 5 ) edited so late for: Sorry I wrote it late last night and forgot to really explain what it did.
  5. darkfreaks your code doesn't really fix the problem, though it might possibly point him/her in the right direction. That is, it just adds an extra condition in there to see if any results are returned. If it's being triggered then he may come a step closer to figuring out what the problem really is. babydolphin, are you not getting any error messages? If not, then try what darkfreaks suggested; is the "The MYSQL columns are empty!" message being displayed? Check to make sure your column names are correct in your $row[...] echoes. For example, should they be capitalized? Maybe a stupid question, but are you sure there is data to be retrieved?
  6. google captcha tutorials it's the same principle. p.s.- I see at least one error in your script: you are trying to make a header() call after you have output.
  7. Lots of book suggestions in a sticky in misc forum. Thread closed.
  8. Nah. Americans just have really low standards. edit: I can generally point at things and use a word or two without fear of being shot (for the most part...) in Spanish, German, Latin and Japanese.
  9. So are you a mod of their forums or somehow a part of their staff or otherwise affiliated with them?
  10. Well in the end #2 didn't really count, as Eric did approve paying for it. Main thing was the #1. I was one of the "Sure, why not? New shiny buttons!" votes. But I do understand the whole "If it ain't broke, don't fix it" arguments that detailed #1.
  11. Really? Because he said:
  12. If all you want is a number to be displayed...what not just do $displayday = $_POST['day'] +1; ?
  13. Actually, since PHP is a loosely typed language, you don't need to force type casts if that's all that's in your vars are the numbers.
  14. @Maq: if you notice at the top of the code snippet, $stringlevel is defined, doing the same thing you suggested.
  15. If you have a column called for instance 'sevenlevel' and $string == 'seven' then echo $row[$string . 'level']; Should have worked. Alternatively you could do echo $row["{$string}level"]; Or concat it beforehand like Zhadus mentioned. Perhaps $string does not contain the value you are expecting?
  16. Just out of curiosity why hasn't PHPFREAKS bridged their forums to the main site, so you only have to login once? Because the powers that be do not feel it is something necessary.
  17. You use the same login info but you have to login to each one individually; that is, logging into one won't automatically make you logged into the other.
  18. session_register is deprecated. Use $_SESSION['myusername'] instead. No declaring or anything.
  19. You use the same login info as you do for logging into the forums. You do not have to login on the main site to see all of the available tutorials. Just click the Tutorials link on the Navigation Menu on the main site.
  20. I'm so mad I could rip a napkin. Whoa careful there buddy, that's serious business. Make sure you do your stretches first.
  21. If Microsoft products really were conclusively as horrible as people make them out to be, they'd be out of business. But they aren't, so they must be doing something right. And claiming it's because most people are ignorant is not a valid argument. If anything, I give Microsoft major credit for not only being able to stay afloat, but consistently dominating their markets, despite consistent trash talking from people who TBH I think just spout off whatever heard from their friend who heard from their friend who heard from some dude, having not actually done any real research for themselves on the matter. I echo Dan's sentiments.
  22. I haven't been here that long but from what the description seems like the button has been in the same spot for quite a long time, so what's the difference of how old these threads are? Right: it hasn't really changed. But that wasn't the point. If anything, the fact that the button hasn't changed argues against you. The point is, out of all the threads and posts that have been/are being generated, you came up with one old and one very old example.
  23. So you did some kind of "topic solved" search to see what you could come up with, and all you came up with was two threads: one from 4 months ago and the other from a year and a half ago...considering we are currently averaging about 150 topics, 750 posts a day, I really don't see the problem. I do agree with you that a fair amount of solved topics do not get the solved topic tag, but again, I really don't think that has anything to do with people not being able to find the button. IMO most people simply don't bother. Or when they have a question, they post it on several boards. First one to post gets the "Thank you" or the "Solved" or the whatever else, if anything at all, and poster usually doesn't bother responding in any subsequent board's thread. Evidence of this hypothesis can be seen in the many "Wow, you guys are always the fastest to respond," or "Thx anyways, I already got an answer on xyz board," posts.
  24. strtotime time
×
×
  • 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.