Jump to content

Philip

Staff Alumni
  • Posts

    4,665
  • Joined

  • Last visited

  • Days Won

    20

Everything posted by Philip

  1. Bastard, got something to say about Texas?
  2. What are you trying to accomplish with this? This code doesn't make much sense to me. You're trying to concat a string onto an array. I'm guessing you want to do like $cookie0[] = '^'.$cookie0[$i] instead?
  3. Just my version of TLG's code: <?php // Array of words we will check for $wordList = array('cats','dogs','frog','mice','fart','mart','kart'); // An array of the letters $letters = range('a', 'z'); // Set the counter at one $c = 1; // Figure out the start time $starttime = microtime(); $startarray = explode(" ", $starttime); $starttime = $startarray[1] + $startarray[0]; // Start the main loop while(!in_array($st, $wordList)) { // Shuffle the letter list shuffle($letters); // Grab the first four letters: // (Note you could also use $st = implode(array_slice($letters, 0, 4)); // But I think that would use waster more system resources by running more // functions than really needed....) $st = $letters[0].$letters[1].$letters[2].$letters[3]; // Just to show what word we are on echo $c,' ',$st,'<br>'; // Increment the counter $c++; } // Figure out the finish time $endtime = microtime(); $endarray = explode(" ", $endtime); $endtime = $endarray[1] + $endarray[0]; echo 'Page loaded in ', round($endtime-$starttime, 4), ' seconds with a total of ',$c,' tries'; ?> Simplifies the while loop and shows the load time. Just FYI - it is possible for bigger words that your script could time out trying to find the correct word.
  4. You could put it in a for loop... but you could be waiting a while. After all that's only 456,976 possible combinations of 4 letter words
  5. Yeah, and I'm blind too haha. Running it in something like PhpMyAdmin returns nothing as well?
  6. add or die(mysql_error()); $ret = mysql_query($q) or die(mysql_error());
  7. Opps, it should have thrown an error for it anyways. (note the different tick marks) SELECT `sup` FROM `sprint` WHERE `sup` IS NOT NULL GROUP BY `sup`
  8. I think it's because if ($this->link->connect_error) will always be true try: if (!empty($this->link->connect_error))
  9. select `sup` from `sprint` WHERE `sup` IS NOT NULL GROUP BY 'sup'
  10. Well, I wouldn't worry about it too much. Hell, it happens to me on GMail from time to time, and they pretty much optimized the browser to work well with their own sites
  11. This is a Chrome issue. I've been trying to figure it out myself, as it happens on several of my sites + others. I thought they had fixed it a few months ago, but it started popping up again in the past 2 weeks.
  12. Not sure why you are trying to escape those quotes
  13. You can with one of these functions: round, floor, ceiling
  14. Philip

    add numbers

    I haven't tried it, but I've heard that using TIMESTAMPADD() works sometimes. I'll see if I can pull up that article
  15. Try: $query = "SELECT * FROM `records` WHERE firstName LIKE '$firstName%' OR lastName LIKE '$lastName%' OR age LIKE '$age%' OR sex LIKE '$sex%' OR raceName LIKE '$raceName%' OR distance LIKE '$distance%' OR city LIKE '$city%' OR state LIKE '$state%' OR `date` LIKE '$date%' OR `time` LIKE '$time%' OR place LIKE '$place%' OR divPlace LIKE '$divPlace%' OR pace LIKE '$pace%'";
  16. Philip

    add numbers

    Use the datetime functions: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html
  17. Haha there are quite a few nutty cars around here. Thanks Austin, TX for being so damn weird.
  18. Philip

    add numbers

    UPDATE `user` SET `hours`=`hours`+200 WHERE `user_id` = 1 You don't need the quotes around the col name like that
  19. It's not practical, but in one line (not cheating like Maq ) return implode(array_slice(explode(':',$content),2,1));
  20. $text = 'I have spaces'; $output = str_replace(' ','', $text); echo $output; // shows 'Ihavespaces'
  21. I'll second that. I prefer my Border Collie, how can you say no to this: http://img5.imageshack.us/img5/4143/n59213246710497069583.jpg
  22. This page will help you http://dev.mysql.com/doc/mysqld-version-reference/en/mysqld-version-reference-reservedwords.html
  23. to is a reserved word. Either rename the column or change it in the query to `to`
  24. <?php phpinfo(); ?>
  25. http://css-tricks.com/css-trick-creating-a-body-border/ That should border in everything
×
×
  • 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.