Re: [PHP] PHP Command line script

2007-05-01 Thread Greg Donald
On 5/1/07, Nathaniel Hall <[EMAIL PROTECTED]> wrote: I am attempting to run a script that will run from the command line nightly to update a field in a database. I already created a script that would access the database and insert most of the information when a webpage is visited and I had no pr

Re: [PHP] PHP Command line script

2007-05-01 Thread Nathaniel Hall
Daniel Brown wrote: First and foremost, it's a VERY BAD idea to use root for MySQL. If your code isn't perfect (and even sometimes if it is), arbitrary commands and SQL injection attacks could lead to migraines that no Tylenol will ever be able to alleviate. I changed the user I was conn

Re: [PHP] Deviation? Distribution? OT?

2007-05-01 Thread Daniel Brown
I don't think I'm quite following why you wouldn't just want to break it up into groups of 20 On 5/1/07, Richard Lynch <[EMAIL PROTECTED]> wrote: My boss and the web designer have decided to do something that requires statistical formulae well beyond my statistically-challenged capabil

[PHP] Deviation? Distribution? OT?

2007-05-01 Thread Richard Lynch
My boss and the web designer have decided to do something that requires statistical formulae well beyond my statistically-challenged capabilities, so I'm turning to y'all... Basically, the current query looks something like this: select * from (select whatever, count(*) as popular from the_t

Re: [PHP] PHP Command line script

2007-05-01 Thread Daniel Brown
First and foremost, it's a VERY BAD idea to use root for MySQL. If your code isn't perfect (and even sometimes if it is), arbitrary commands and SQL injection attacks could lead to migraines that no Tylenol will ever be able to alleviate. Secondly, what error is the CLI kicking out when yo

[PHP] PHP Command line script

2007-05-01 Thread Nathaniel Hall
I am attempting to run a script that will run from the command line nightly to update a field in a database. I already created a script that would access the database and insert most of the information when a webpage is visited and I had no problems with it. The command line script appears to

Re: [PHP] exec() and redirect output of program [SOLVED]

2007-05-01 Thread Daniel Brown
Brad, The error_log file is written by httpd (Apache). It actually just sounds like they need to upgrade their Zend Optimizer, which is a cinch to do. On 5/1/07, Brad Fuller <[EMAIL PROTECTED]> wrote: Tijnema ! wrote: > On 5/1/07, Brad Fuller <[EMAIL PROTECTED]> wrote: >> Brad Fuller wr

RE: [PHP] exec() and redirect output of program [SOLVED]

2007-05-01 Thread Brad Fuller
Tijnema ! wrote: > On 5/1/07, Brad Fuller <[EMAIL PROTECTED]> wrote: >> Brad Fuller wrote: >>> Daniel Brown wrote: This way just lets it do it's own thing, with no output, and PHP won't hang. It'll continue from the CLI after the HTTP session is over. >>> exec('php t

Re: [PHP] Re: What does "<<<" mean?

2007-05-01 Thread Tijnema !
I doubt Microsoft develops an editor that I could use on my Linux system for this... Cheers, Mattias You could use a silly editor from Microsoft, and then run it using Wine. Tijnema -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: What does "<<<" mean?

2007-05-01 Thread Robert Cummings
On Tue, 2007-05-01 at 12:28 -0700, Mattias Thorslund wrote: > Robert Cummings wrote: > > Now, I would wish for my editor to also indent multi-line strings in the > same fashion. Essentially, the lines of $sql_ugly in my example above > should be displayed in alignment with the indentation: > > if(

Re: [PHP] Re: What does "<<<" mean?

2007-05-01 Thread Mattias Thorslund
Robert Cummings wrote: > On Tue, 2007-05-01 at 08:36 -0700, Mattias Thorslund wrote: > >> Man-wai Chang wrote: >> >>> Bash uses only 2. PHP uses 3. And I am using this: >>> >>> $sql=" >>> select ... >>> from >>> left join ... >>> on >>> where . >>> "; >>>

Re: [PHP] exec() and redirect output of program

2007-05-01 Thread Tijnema !
On 5/1/07, Brad Fuller <[EMAIL PROTECTED]> wrote: Brad Fuller wrote: > Daniel Brown wrote: >> This way just lets it do it's own thing, with no output, and PHP >> won't hang. It'll continue from the CLI after the HTTP session is >> over. >> >> > exec('php test.php > /dev/null 2>&1 &'); ?> >>

RE: [PHP] exec() and redirect output of program

2007-05-01 Thread Brad Fuller
Brad Fuller wrote: > Daniel Brown wrote: >> This way just lets it do it's own thing, with no output, and PHP >> won't hang. It'll continue from the CLI after the HTTP session is >> over. >> >> > exec('php test.php > /dev/null 2>&1 &'); ?> >> >> >> On 5/1/07, Brad Fuller <[EMAIL PROTECTED]>

Re: [PHP] What does "<<<" mean?

2007-05-01 Thread Richard Davey
Greg Donald wrote: On 4/30/07, Richard Davey <[EMAIL PROTECTED]> wrote: I'm not dissing heredoc syntax, it has its uses (now and again) but it's far from "clean", especially when embedded deep in classes Classes? PHP is the absolute worst language to do OO programming in. If you like OO, mov

RE: [PHP] exec() and redirect output of program

2007-05-01 Thread Brad Fuller
Daniel Brown wrote: > This way just lets it do it's own thing, with no output, > and PHP won't hang. It'll continue from the CLI after the HTTP > session is over. > > exec('php test.php > /dev/null 2>&1 &'); ?> > > > On 5/1/07, Brad Fuller <[EMAIL PROTECTED]> wrote: >> >> >> I found thi

Re: [PHP] Re: What does "<<<" mean?

2007-05-01 Thread Robert Cummings
On Tue, 2007-05-01 at 08:36 -0700, Mattias Thorslund wrote: > Man-wai Chang wrote: > > > > Bash uses only 2. PHP uses 3. And I am using this: > > > > $sql=" > > select ... > > from > > left join ... > > on > > where . > > "; > > > Exactly. I never saw the point i

[PHP] mime_magic support empty ?

2007-05-01 Thread Alain Roger
Hi, I previously wrote a post about mime_magic issue. i would like to add some details about result from phpinfo() function. when i check it i can see that "mime_magic support" is empty. not set to enabled or disabled... only empty cell. I also tried the standard magic.mime file delivered with P

Re: [PHP] exec() and redirect output of program

2007-05-01 Thread Daniel Brown
This way just lets it do it's own thing, with no output, and PHP won't hang. It'll continue from the CLI after the HTTP session is over. /dev/null 2>&1 &'); ?> On 5/1/07, Brad Fuller <[EMAIL PROTECTED]> wrote: I found this on PHP.net: http://us.php.net/manual/en/function.exec.php Note

Re: [PHP] resize image and store it to DB

2007-05-01 Thread Robert Cummings
On Tue, 2007-05-01 at 11:08 -0400, tedd wrote: > At 12:54 PM +0200 5/1/07, Alain Roger wrote: > > > >i do not want to create a tmp file on server and after load it. > >I would like to do it stored image directly into DB on-fly. > > Why? > > My understanding is that when you upload a file, it has

Re: [PHP] Re: What does "<<<" mean?

2007-05-01 Thread Mattias Thorslund
Man-wai Chang wrote: > > Bash uses only 2. PHP uses 3. And I am using this: > > $sql=" > select ... > from > left join ... > on > where . > "; Exactly. I never saw the point in complicating my life with heredocs when both single- and double-quoted strings can con

Re: [PHP] resize image and store it to DB

2007-05-01 Thread tedd
At 12:54 PM +0200 5/1/07, Alain Roger wrote: i do not want to create a tmp file on server and after load it. I would like to do it stored image directly into DB on-fly. Why? My understanding is that when you upload a file, it has to go somewhere. It might as well go into a tmp folder/file th

RE: [PHP] Re: What does "<<<" mean?

2007-05-01 Thread Robert Cummings
On Tue, 2007-05-01 at 15:01 +0100, Edward Kay wrote: > <<< END > some code > END > >> Bash redirection... :) > > > Syntax error ;) > > Key stuck on keyboardd :) *lol* -- .. | InterJinn App

Re: [PHP] What does "<<<" mean?

2007-05-01 Thread Greg Donald
On 4/30/07, Micky Hulse <[EMAIL PROTECTED]> wrote: Greg Donald wrote: > Try Rubyonrails, it's the best cure for the MVC itch. Django framework is pretty nice too. :) Django is very under-developed compared to Rails. There's not a Javascript library in sight and the developers have a "do it yo

RE: [PHP] Re: What does "<<<" mean?

2007-05-01 Thread Edward Kay
<<< END some code END >> Bash redirection... :) > Syntax error ;) Key stuck on keyboardd :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: What does "<<<" mean?

2007-05-01 Thread Man-wai Chang
<<< END some code END Bash redirection... :) Syntax error ;) Bash uses only 2. PHP uses 3. And I am using this: $sql=" select ... from left join ... on where . "; -- .~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org / v \ Simplic

Re: [PHP] newbie needs help

2007-05-01 Thread Ben Clapp
I do apologize for the non-list reply, I will make sure and keep that in there on the next emails. I checked this morning and there was only one image, so the second mymonth code did not execute, but I replaced the code with what Richard gave me and it works also. And about the {} brackets, I a

Re: [PHP] Re: What does "<<<" mean?

2007-05-01 Thread Robert Cummings
On Tue, 2007-05-01 at 20:40 +0800, Man-wai Chang wrote: > >> <<< END > >> some code > >> END > > It's heredoc syntax. > > http://us2.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc > > > > > > Bash redirection... :) Syntax error ;) Cheers, Rob. -- .-

[PHP] magic.mime

2007-05-01 Thread Alain Roger
Hi, I know that magic.mime is depreciated but i would like to test a simple thing. However, i have some issues with it it does not work :-( basically, my php.ini file points as following : mime_magic.magicfile = "x:\PHP511\extras\magic.mime" I also enabled the dll via : extension=php_m

[PHP] Re: What does "<<<" mean?

2007-05-01 Thread Man-wai Chang
<<< END some code END It's heredoc syntax. http://us2.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc Bash redirection... :) -- .~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org / v \ Simplicity is Beauty! May the Force and Farce

Re: [PHP] resize image and store it to DB

2007-05-01 Thread Robert Cummings
On Tue, 2007-05-01 at 12:59 +0200, Tijnema ! wrote: > > I don't know if there's a better way, but you could try output > buffering, so that you start it, output the image with imagejpeg, > imagepng, imagegif, etc. and then get the contents of the buffer. That's what I'd suggest also... since it's

Re: [PHP] resize image and store it to DB

2007-05-01 Thread Tijnema !
On 5/1/07, Alain Roger <[EMAIL PROTECTED]> wrote: Hi, I allow web application users to insert their own picture into database. but i defined a max size limit 130 px width by 160px height. so for that i determine the max ratio in case of picture does not have this size. after that i resize it an

[PHP] resize image and store it to DB

2007-05-01 Thread Alain Roger
Hi, I allow web application users to insert their own picture into database. but i defined a max size limit 130 px width by 160px height. so for that i determine the max ratio in case of picture does not have this size. after that i resize it and would like to store it to DB, however i have some

Re: [PHP] sloppy use of constants as strings. WAS: What does "<<<" mean?

2007-05-01 Thread Robin Vickery
On 01/05/07, Daevid Vincent <[EMAIL PROTECTED]> wrote: > > > echo << > > BROWSER: $_SERVER[HTTP_USER_AGENT] > > > EOF; > > > > Isn't that form (sans quote marks) deprecated and frowned upon? > > > error_reporting( E_ALL ); > > echo << BROWSER: $_SERVER[HTTP_USER_AGENT] > EOF; > > Why would clean