php-general Digest 30 Jun 2009 10:33:10 -0000 Issue 6203

2009-06-30 Thread php-general-digest-help
php-general Digest 30 Jun 2009 10:33:10 - Issue 6203 Topics (messages 294723 through 294731): Re: Named pair array from variable 294723 by: Ashley Sheridan 294724 by: Shawn McKenzie 294725 by: Shawn McKenzie Re: Best way to reinstate radio-button states from

[PHP] Scope woe

2009-06-30 Thread Luke
Hello again guys, I was wondering the best way to tackle the following problem: I've got a class, containing a property which is another object. So from outside I should be able to do $firstobject-propertycontainingobject-methodinsidethatobject(); The $firstobject variable is in the global

[PHP] Push an Array, Comma separated.

2009-06-30 Thread Louie Miranda
GPS Administrative Page v2.3.12 (BETA)My array: Array ( [0] = Demo2.txt [1] = Demo.txt [2] = Demo.txt ) How could I push the values as: - Demo2.txt, Demo.txt, Demo.txt? Not sure which approach is good. $saveFiles = array(); array_push($saveFiles, $ufName); Help -- Louie Miranda

Re: [PHP] Push an Array, Comma separated.

2009-06-30 Thread Richard Heyes
My array: Array ( [0] = Demo2.txt [1] = Demo.txt [2] = Demo.txt ) How could I push the values as: - Demo2.txt, Demo.txt, Demo.txt? Not sure which approach is good. $saveFiles = array(); array_push($saveFiles, $ufName); you could use array_push(), or the shorter syntax: o

RE: [PHP] guide me please

2009-06-30 Thread Suresh Gupta VG
Hi All, Should I need to install php5.X version. If so, can you please give me the link where I can get the source for AIX and install over php4.X. Secondly, I used a simple code as below to get the output, but now, it gives blank page. html head titlePHP Test/title /head body ?php

[PHP] Re: Push an Array, Comma separated.

2009-06-30 Thread Jo�o C�ndido de Souza Neto
May be array_merge($array, explode(,, $string)). -- João Cândido de Souza Neto SIENS SOLUÇÕES EM GESTÃO DE NEGÓCIOS Fone: (0XX41) 3033-3636 - JS www.siens.com.br Louie Miranda lmira...@gmail.com escreveu na mensagem news:5016fc50906300125s12389ae1v3323c63c30343...@mail.gmail.com... GPS

[PHP] Re: Scope woe

2009-06-30 Thread Jo�o C�ndido de Souza Neto
I think the best way is passing the object instance as a parameter to the messwithotherthings method. -- João Cândido de Souza Neto SIENS SOLUÇÕES EM GESTÃO DE NEGÓCIOS Fone: (0XX41) 3033-3636 - JS www.siens.com.br Luke l...@blog-thing.com escreveu na mensagem

[PHP] Re: Scope woe

2009-06-30 Thread Peter Ford
Luke wrote: Hello again guys, I was wondering the best way to tackle the following problem: I've got a class, containing a property which is another object. So from outside I should be able to do $firstobject-propertycontainingobject-methodinsidethatobject(); The $firstobject variable

Re: [PHP] Re: Scope woe

2009-06-30 Thread Eddie Drapkin
It should be passed into the constructor as a parameter. If you're using OOP properly, there's no reason to use $GLOBALS, ever. Any variable in the $GLOBALS array exists twice in memory, so just keep that in mind, if you plan to use it. On Tue, Jun 30, 2009 at 8:43 AM, Peter

[PHP] PHP 5.3.0 Released!

2009-06-30 Thread Lukas Kahwe Smith
Hello! The PHP Development Team would like to announce the immediate release of PHP 5.3.0. This release is a major improvement in the 5.X series, which includes a large number of new features and bug fixes. Release Announcement: http://www.php.net/release/5_3_0.php Downloads:

[PHP] Re: PHP 5.3.0 Released!

2009-06-30 Thread pan
Lukas Kahwe Smith wrote: Hello! The PHP Development Team would like to announce the immediate release of PHP 5.3.0. This release is a major improvement in the 5.X series, which includes a large number of new features and bug fixes. Release Announcement: http://www.php.net/release/5_3_0.php

[PHP] Managed job chains

2009-06-30 Thread Suresh Gupta VG
Hi List, Please find the error message below when I logged into managed jobs. Please advice me to get rid of this. The PHP-Extension domxml is needed to display job scheduler informations Please adjust the setting in the coniguration file php.ini repeat status check

Re: [PHP] Managed job chains

2009-06-30 Thread Stuart
2009/6/30 Suresh Gupta VG sures...@zensar.com: Hi List, Please find the error message below when I logged into managed jobs. Please advice me to get rid of this.         The PHP-Extension domxml is needed to display job scheduler informations Please adjust the setting in the coniguration

Re: [PHP] Managed job chains

2009-06-30 Thread Daniel Brown
On Tue, Jun 30, 2009 at 09:42, Suresh Gupta VGsures...@zensar.com wrote: Hi List, Please find the error message below when I logged into managed jobs. Please advice me to get rid of this. Get rid of this.         The PHP-Extension domxml is needed to display job scheduler

[PHP] Compare and inserting with php

2009-06-30 Thread Miller, Terion
Okay, what I am trying to do is this: I have a db full of inspections, daily I need to run a script that will grab the posting of inspections, check them against the db to make sure they aren't duplicates and then insert all the new entries. Not sure if my logic of going about it this way is

Re: [PHP] Re: Scope woe

2009-06-30 Thread Luke
2009/6/30 Eddie Drapkin oorza...@gmail.com It should be passed into the constructor as a parameter. If you're using OOP properly, there's no reason to use $GLOBALS, ever. Any variable in the $GLOBALS array exists twice in memory, so just keep that in mind, if you plan to use it. On Tue,

Re: [PHP] Re: PHP 5.3.0 Released!

2009-06-30 Thread Luke
2009/6/30 pan p...@syix.com Lukas Kahwe Smith wrote: Hello! The PHP Development Team would like to announce the immediate release of PHP 5.3.0. This release is a major improvement in the 5.X series, which includes a large number of new features and bug fixes. Release Announcement:

Re: [PHP] Compare and inserting with php

2009-06-30 Thread Ashley Sheridan
On Tuesday 30 June 2009 15:42:01 Miller, Terion wrote: Okay, what I am trying to do is this: I have a db full of inspections, daily I need to run a script that will grab the posting of inspections, check them against the db to make sure they aren't duplicates and then insert all the new

Re: [PHP] Re: Scope woe

2009-06-30 Thread Peter Ford
Luke wrote: Thanks for the replies :) Surely if I pass it as a parameter to the __construct then I would have to make an instance of the otherObject, notice that messwithotherthings is static? Also, if I'm not using OOP properly, Eddie, how would I use it properly to prevent this

Re: [PHP] Re: Scope woe

2009-06-30 Thread Eddie Drapkin
On Tue, Jun 30, 2009 at 10:44 AM, Lukel...@blog-thing.com wrote: 2009/6/30 Eddie Drapkin oorza...@gmail.com It should be passed into the constructor as a parameter.  If you're using OOP properly, there's no reason to use $GLOBALS, ever.  Any variable in the $GLOBALS array exists twice in

Re: [PHP] Re: Scope woe

2009-06-30 Thread Eddie Drapkin
On Tue, Jun 30, 2009 at 11:12 AM, Peter Fordp...@justcroft.com wrote: Luke wrote: Thanks for the replies :) Surely if I pass it as a parameter to the __construct then I would have to make an instance of the otherObject, notice that messwithotherthings is static? Also, if I'm not using OOP

Re: [PHP] Compare and inserting with php

2009-06-30 Thread Bastien Koert
On Tue, Jun 30, 2009 at 11:17 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Tuesday 30 June 2009 15:42:01 Miller, Terion wrote: Okay, what I am trying to do is this: I have a db full of inspections, daily I need to run a script that will grab the posting of inspections, check them

[PHP] Re: [PHP-DEV] Re: [PHP] PHP 5.3.0alpha2

2009-06-30 Thread Evert | Filemobile
On 4-Sep-08, at 12:06 AM, Andi Gutmans wrote: Btw, contrary to what many believe, 32bit PHP tends to perform better than 64bit PHP. So unless there's a really good reason why you want 64bit I wouldn't waste too much time on that. I have heard this before, but CPU hasn't really been our

Re: [PHP] Compare and inserting with php

2009-06-30 Thread Miller, Terion
On 6/30/09 10:40 AM, Bastien Koert phps...@gmail.com wrote: On Tue, Jun 30, 2009 at 11:17 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Tuesday 30 June 2009 15:42:01 Miller, Terion wrote: Okay, what I am trying to do is this: I have a db full of inspections, daily I need to run a

Re: [PHP] Re: Scope woe

2009-06-30 Thread Paul M Foster
On Tue, Jun 30, 2009 at 11:17:17AM -0400, Eddie Drapkin wrote: snip I wouldn't really recommend going with a singleton in this situation, as there exists a different solution (my other post :P) and there are very few actual use-cases where the pattern makes sense, and deploying it

Re: [PHP] Re: Scope woe

2009-06-30 Thread Eddie Drapkin
On Tue, Jun 30, 2009 at 12:37 PM, Paul M Fosterpa...@quillandmouse.com wrote: On Tue, Jun 30, 2009 at 11:17:17AM -0400, Eddie Drapkin wrote: snip I wouldn't really recommend going with a singleton in this situation, as there exists a different solution (my other post :P) and there are very

Re: [PHP] Compare and inserting with php

2009-06-30 Thread Bastien Koert
On Tue, Jun 30, 2009 at 12:09 PM, Miller, Teriontmil...@springfi.gannett.com wrote: On 6/30/09 10:40 AM, Bastien Koert phps...@gmail.com wrote: On Tue, Jun 30, 2009 at 11:17 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Tuesday 30 June 2009 15:42:01 Miller, Terion wrote: Okay,

Re: [PHP] Compare and inserting with php

2009-06-30 Thread Miller, Terion
Does this list of inspections exist in the db? Could you not use an INSERT INTO SELECT * FROM TABLE WHERE type statement...much less processing overhead then -- Bastien Cat, the other other white meat Hi Bastien, Something like this is what you mean? if (!empty($Go)) {

Re: [PHP] Compare and inserting with php

2009-06-30 Thread Andrew Ballard
On Tue, Jun 30, 2009 at 2:19 PM, Miller, Teriontmil...@springfi.gannett.com wrote: Does this list of inspections exist in the db? Could you not use an INSERT INTO SELECT * FROM TABLE WHERE type statement...much less processing overhead then -- Bastien Cat, the other other white meat

Re: [PHP] Compare and inserting with php

2009-06-30 Thread Tom Worster
On 6/30/09 11:17 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: It's a bad way of doing it, but could you not create a unique index on the particular key you want to be unique, and then just try the select anyway with the mysql_query() call preceeded with an @ to suppress warnings? if

Re: [PHP] Compare and inserting with php

2009-06-30 Thread Miller, Terion
On 6/30/09 1:31 PM, Tom Worster f...@thefsb.org wrote: On 6/30/09 11:17 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: It's a bad way of doing it, but could you not create a unique index on the particular key you want to be unique, and then just try the select anyway with the

Re: [PHP] Best way to reinstate radio-button states from database?

2009-06-30 Thread Tom Worster
On 6/29/09 10:26 PM, Michael A. Peters mpet...@mac.com wrote: Rob Gould wrote: I have a webpage which allows people to log in and make selections with radio buttons and hit SUBMIT and saves the data from those radio buttons to a mySQL database. However, I'm finding that I also need the

[PHP] exasperated again

2009-06-30 Thread PJ
Could somebody please explain to me what is wrong with this code? In my script it works, returns the correct id, but when I try it in a test pages, nothing in the world gets it to work. This is rather frustrating, again: THIS WORKS IN ANOTHER PAGE; IN THE TEST PAGE ID DOES NOT. $sql = SELECT id

Re: [PHP] exasperated again - shot in the foot

2009-06-30 Thread PJ
PJ wrote: Could somebody please explain to me what is wrong with this code? In my script it works, returns the correct id, but when I try it in a test pages, nothing in the world gets it to work. This is rather frustrating, again: THIS WORKS IN ANOTHER PAGE; IN THE TEST PAGE ID DOES NOT.

Re: [PHP] exasperated again

2009-06-30 Thread Andrew Ballard
On Tue, Jun 30, 2009 at 4:01 PM, PJaf.gour...@videotron.ca wrote: Could somebody please explain to me what is wrong with this code? In my script it works, returns the correct id, but when I try it in a test pages, nothing in the world gets it to work. This is rather frustrating, again: THIS

Re: [PHP] exasperated again - shot in the foot

2009-06-30 Thread Bastien Koert
On Tue, Jun 30, 2009 at 4:48 PM, PJaf.gour...@videotron.ca wrote: PJ wrote: Could somebody please explain to me what is wrong with this code? In my script it works, returns the correct id, but when I try it in a test pages, nothing in the world gets it to work. This is rather frustrating,

Re: [PHP] exasperated again - shot in the foot

2009-06-30 Thread Eddie Drapkin
On Tue, Jun 30, 2009 at 4:50 PM, Bastien Koertphps...@gmail.com wrote: On Tue, Jun 30, 2009 at 4:48 PM, PJaf.gour...@videotron.ca wrote: PJ wrote: Could somebody please explain to me what is wrong with this code? In my script it works, returns the correct id, but when I try it in a test

RE: [PHP] exasperated again - shot in the foot

2009-06-30 Thread Jay Blanchard
[snip] Use the OOP interface to mysqli or PDO and these problems don't happen [/snip] Either that or include a modicum of error checking in your code. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Scope woe

2009-06-30 Thread Shawn McKenzie
Eddie Drapkin wrote: On Tue, Jun 30, 2009 at 10:44 AM, Lukel...@blog-thing.com wrote: What I meant, and I probably sounded a bit rougher than I absolutely had to, was that it's pretty universally lazy and/or bad design to use global variables inside a class, because classes have member

Re: [PHP] Re: Scope woe

2009-06-30 Thread Eddie Drapkin
You are correct as there was no metaphor in here at all!  This, It helps to think of classes like cars on a highway, is almost a simile, but on the whole I would probably say that you were using an analogy :-) HEIL SPELLCHECK! I bow to my grammar nazi superior *bow* -- PHP General Mailing

[PHP] check a variable after EACH function

2009-06-30 Thread Flint Million
This might seem silly but here's what I'm trying to do Suppose I have some kind of check variable - say for example $abort_now. Or it could be a function. Something to be evaluated to a value. I want to execute a block of statements, but after EACH statement executes, check the value of

[PHP] Re: check a variable after EACH function

2009-06-30 Thread Shawn McKenzie
Flint Million wrote: This might seem silly but here's what I'm trying to do Suppose I have some kind of check variable - say for example $abort_now. Or it could be a function. Something to be evaluated to a value. I want to execute a block of statements, but after EACH statement

Re: [PHP] Best way to reinstate radio-button states from database?

2009-06-30 Thread Michael A. Peters
Tom Worster wrote: *snip* michael: radios and checkboxes take the checked attribute -- options in selects take the selected attribute. Doh - I knew that. Typo. I always thought it silly there were two different attributes anyway, when they basically are same thing and can never both occur in

Re: [PHP] exasperated again - shot in the foot

2009-06-30 Thread PJ
Jay Blanchard wrote: [snip] Use the OOP interface to mysqli or PDO and these problems don't happen [/snip] Either that or include a modicum of error checking in your code. OK, Ok, I feel stupid enough already. I'm not sure I want to get in that deep... it's tough enough with the simple

[PHP] Cleaning up automatically when leaving a page

2009-06-30 Thread Mary Anderson
Hi all, I have a php application for which I have a page which creates temporary junk and puts it into a persistent store (in this case a postgres database, but that is beside the point.) I have a Save button which puts the stuff I really want into the persistent store and cleans up

Re: [PHP] Cleaning up automatically when leaving a page

2009-06-30 Thread Michael A. Peters
Mary Anderson wrote: Hi all, I have a php application for which I have a page which creates temporary junk and puts it into a persistent store (in this case a postgres database, but that is beside the point.) I have a Save button which puts the stuff I really want into the persistent

Re: [PHP] check a variable after EACH function

2009-06-30 Thread Paul M Foster
On Tue, Jun 30, 2009 at 06:31:54PM -0500, Flint Million wrote: This might seem silly but here's what I'm trying to do Suppose I have some kind of check variable - say for example $abort_now. Or it could be a function. Something to be evaluated to a value. I want to execute a block of

Re: [PHP] Cleaning up automatically when leaving a page

2009-06-30 Thread Paul M Foster
On Tue, Jun 30, 2009 at 06:38:19PM -0700, Mary Anderson wrote: Hi all, I have a php application for which I have a page which creates temporary junk and puts it into a persistent store (in this case a postgres database, but that is beside the point.) I have a Save button which puts

Re: [PHP] Re: Push an Array, Comma separated.

2009-06-30 Thread Louie Miranda
This is what I did. And it worked. $saveFiles = array(); $arrSize=sizeof($saveFiles); for ($number = 0; $number $arrSize; $number++) { $saveFilesDump = $saveFiles[$number], ; echo $saveFiles[$number], ; } File1.txt, File2.txt, File3.txt,

Re: [PHP] Cleaning up automatically when leaving a page

2009-06-30 Thread WenDong Zhang
yes, the browser evoke unload event when leave the page (back, forward, or close). you can send a message via ajax, but it may not been received by the server successful, (when close the browser) I think the best way is maintaining a timestamp as michael paul say, and clear the 'junk' timely.

Re: [PHP] check a variable after EACH function

2009-06-30 Thread Phpster
On Jun 30, 2009, at 10:48 PM, Paul M Foster pa...@quillandmouse.com wrote: On Tue, Jun 30, 2009 at 06:31:54PM -0500, Flint Million wrote: This might seem silly but here's what I'm trying to do Suppose I have some kind of check variable - say for example $abort_now. Or it could be a

Re: [PHP] Cleaning up automatically when leaving a page

2009-06-30 Thread Phpster
On Jun 30, 2009, at 10:59 PM, Paul M Foster pa...@quillandmouse.com wrote: On Tue, Jun 30, 2009 at 06:38:19PM -0700, Mary Anderson wrote: Hi all, I have a php application for which I have a page which creates temporary junk and puts it into a persistent store (in this case a

Re: [PHP] check a variable after EACH function

2009-06-30 Thread Paul M Foster
On Tue, Jun 30, 2009 at 11:21:03PM -0400, Phpster wrote: On Jun 30, 2009, at 10:48 PM, Paul M Foster pa...@quillandmouse.com wrote: snip FWIW, I've had to do this exact thing with regard to form validation, except I'm not looping. Check each condition, and if it fails, never mind

Re: [PHP] PHP 5.3.0 Released!

2009-06-30 Thread Michael A. Peters
Lukas Kahwe Smith wrote: Hello! The PHP Development Team would like to announce the immediate release of PHP 5.3.0. This release is a major improvement in the 5.X series, which includes a large number of new features and bug fixes. Release Announcement: http://www.php.net/release/5_3_0.php