Philip
Staff Alumni-
Posts
4,665 -
Joined
-
Last visited
-
Days Won
20
Everything posted by Philip
-
Bastard, got something to say about Texas?
-
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?
-
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.
-
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
-
Yeah, and I'm blind too haha. Running it in something like PhpMyAdmin returns nothing as well?
-
add or die(mysql_error()); $ret = mysql_query($q) or die(mysql_error());
-
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`
-
I think it's because if ($this->link->connect_error) will always be true try: if (!empty($this->link->connect_error))
-
select `sup` from `sprint` WHERE `sup` IS NOT NULL GROUP BY 'sup'
-
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
-
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.
-
Not sure why you are trying to escape those quotes
-
[SOLVED] Displaying a number without the decimal
Philip replied to cliftonbazaar's topic in PHP Coding Help
You can with one of these functions: round, floor, ceiling -
I haven't tried it, but I've heard that using TIMESTAMPADD() works sometimes. I'll see if I can pull up that article
-
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%'";
-
Use the datetime functions: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html
-
I know some people love their circuit boards...
Philip replied to nrg_alpha's topic in Miscellaneous
Haha there are quite a few nutty cars around here. Thanks Austin, TX for being so damn weird. -
UPDATE `user` SET `hours`=`hours`+200 WHERE `user_id` = 1 You don't need the quotes around the col name like that
-
It's not practical, but in one line (not cheating like Maq ) return implode(array_slice(explode(':',$content),2,1));
-
$text = 'I have spaces'; $output = str_replace(' ','', $text); echo $output; // shows 'Ihavespaces'
-
I'll second that. I prefer my Border Collie, how can you say no to this: http://img5.imageshack.us/img5/4143/n59213246710497069583.jpg
-
This page will help you http://dev.mysql.com/doc/mysqld-version-reference/en/mysqld-version-reference-reservedwords.html
-
to is a reserved word. Either rename the column or change it in the query to `to`
-
<?php phpinfo(); ?>
-
http://css-tricks.com/css-trick-creating-a-body-border/ That should border in everything