Re: [PHP] Performance: While or For loop

2007-03-26 Thread Jake Gardner
He said if you run the /script/ itself 1000 times, not a loop with 1000 iterations. This is quite possible; I am fairly certain there are websites out there that get accessed well over 1000 times a minute, yes? So every minute, that website is saving a total of 2.6 seconds to do... whatever it is

Re: [PHP] order/reorder pull out data from arrays

2006-07-11 Thread Jake Gardner
Ok I understand your method now. your code does not match your output. how would your print line produce that , $customerid ? anyways... $data = orders($id,$status); $c = count($data); $currentId; $n = 1; for($i=0; $i<$c; $i++) { $orderid = $data[$i]['orderid']; $customerid = $data[$i]['cu

Re: [PHP] Is there a way to display data from database for Select Options in a form?

2006-01-10 Thread Jake Gardner
Jochem: Your method is long, probably takes more time to run, and is therefore inefficient in this circumstance. There is a time and place for a good solid reusable function, or even a class. Of course things could go wrong when using mySQL connections, but things can always go wrong. Bringing pe

Re: [PHP] Type of form element

2005-11-09 Thread Jake Gardner
Uh isset will work in this particular instance because $_POST is an array whose values are of one type and one type only: STRINGS. Yes, it is true that: $myArray['a'] = NULL; isSet($myArray['a']); //Will return FALSE. However, because $_POST contains STRINGS AND STRINGS ONLY, isSet works: $m

Re: [PHP] Re: comment more than a question

2005-11-09 Thread Jake Gardner
Yeah I never really look at what the error message actually says, it usually turns out to be unhelpful because of those line numbers. I just look, for example, to see if it says the error happened past the last line of the script, and I know im missing a } somewhere. The errors PHP returns are more

[PHP] Object Function-call handling in PHP5

2005-09-28 Thread Jake Gardner
This is a toughy I've been working over for a bit. I was wondering if there is a way to cause objects to have certain behaviors when builtin functions are called, or maybe a way of setting, for example, a "primary" string which is used whenever a function requiring a string calls it. IE: Class my

Re: [PHP] serializing result sets or what?

2005-09-28 Thread Jake Gardner
"You may download this PECL extension DLL from the PHP Downloads page or at http://snaps.php.net/. Note: On Windows, APC expects c:\tmp to exist, and be writable by the web server." On 9/28/05, Thomas <[EMAIL PROTECTED]> wrote: > Thanks, that looks good. But what do I do if OS is WinDoze? The i

[PHP] Pre global configuration

2005-09-27 Thread Jake Gardner
This is a stretch and I doubt you can do this very easily, but I was wondering if there is a way to define behaviors that happen throughout a script before execution for example if the OS is windows, all strings are terminated with \r\n, if Linux, then \n without adding addition ifs throughout the

Re: [PHP] PCRE false match with preg_match?

2005-09-26 Thread Jake Gardner
Murray: I could kick myself for not seeing that one (* = 0 or more, well it sure found 0) On 9/26/05, Murray @ PlanetThoughtful <[EMAIL PROTECTED]> wrote: > > I recently encountered a strange behaviour, could someone please > > countercheck it, to either tell me there is an error in my pattern? >

Re: [PHP] serialize

2005-09-26 Thread Jake Gardner
able result = recieved serialized version of $Joe) $Joe = unserialize($Result); $Results = $Joe->ListVars(); etc. On 9/26/05, Jake Gardner <[EMAIL PROTECTED]> wrote: > I would use a table such as > Table > |_UserData > > Then use objects per user to store the data. > class

Re: [PHP] Trigger root script?

2005-09-26 Thread Jake Gardner
make sure to set www-data's login script to nologin if you are going to do that. On 9/26/05, Michael Sims <[EMAIL PROTECTED]> wrote: > Jeffrey Sambells wrote: > > I need a php script to trigger another script to run as root on a > > machine. Currently, the scripts run as the www-data user, but tha

Re: [PHP] PCRE false match with preg_match?

2005-09-26 Thread Jake Gardner
When using "/([0-9]*)(.*)/i" it matches substring 1: 7005 substring 2: -N/52 When using "/([0-9]*)\/(.*)/i" it matches substring 1: substring 2: 52 It looks to me as though its trying to match either or subgroup in order. On 9/26/05, Jens Schulze <[EMAIL PROTECTED]> wrote: > I recently encounter

Re: [PHP] PHP in a commandline shell?

2005-09-23 Thread Jake Gardner
That depends on several things, chief among which are: What version did you install? What options did you supply ./configure? **Did you delete your old install?** The reason for that is because the difference between the CLI and CGI versions of PHP is the binary w

[PHP] Re: Retrieving variable name?

2005-09-21 Thread Jake Gardner
Maybe something fancy with references? http://us2.php.net/manual/en/language.references.php On 9/21/05, Thorsten Suckow-Homberg <[EMAIL PROTECTED]> wrote: > > Short Answer : No > > Longer Answer : Maybe, if you have knowledge of PHP internals and a > > willingness to write an extension. Even then