Re: [PHP] ZCE question - duplicate object

2009-08-12 Thread Sudheer Satyanarayana
Augusto Flavio wrote: HI everyone, i'm studying for the zce exam and i found a blog that try to answer some questions covered in the exam. I found one that i do not agree. Question: What is wrong with the following code? function duplicate($obj) { $newObj = $obj; return $newObj; } $a = new

[PHP] ZCE question - duplicate object

2009-08-12 Thread Augusto Flavio
HI everyone, i'm studying for the zce exam and i found a blog that try to answer some questions covered in the exam. I found one that i do not agree. Question: What is wrong with the following code? function duplicate($obj) { $newObj = $obj; return $newObj; } $a = new MyClass(); $a_copy = du

Re: [PHP] Displaying user data and picture

2009-08-12 Thread nashrul
>u want help? break down ur question to the point, none is going to downlod >unknown zips searching for the spot. the reason I put the files zipped is that when I put the code that include html tags in the message, they are read as html tags by the browser and displayed not as the code... I don't

[PHP] Re: Design Patterns

2009-08-12 Thread D.M.Jackson
Thank you Martin. I'm new to php and stuff like this and the great folks on this newsgroup really help the newbies like myself learn the language. That's why I like this list and regularly snoop through the threads here. This list is the most helpful resource on php that I've been able to find

[PHP] Remove function

2009-08-12 Thread Allen McCabe
Hey all. I am creating an online order form which will submit an order quest to email, there are no products and no transactions (seat reserving). Currently, I have a form that is populated with shows and times and prices from an external php file (each show is an array, embedded in a shows array

Re: [PHP] Re: Design Patterns

2009-08-12 Thread Ralph Deffke
I wrote this message after spending 1/2 hour at your documentation. I'm sorry, may be I don't have the ability to understand your goal. thats thats why I ask you what is this for. I'm an application programmer with an industrial process control background. A peace of code ment to do something for

Re: [PHP] Re: Design Patterns

2009-08-12 Thread Martin Scotta
On Wed, Aug 12, 2009 at 6:27 PM, Ralph Deffke wrote: > it would help if u would tell us what u want to accomplish with this > ativity > > cheers > ralph_def...@yahoo.de > > "Martin Scotta" wrote in message > news:6445d94e0908121323x721254c4ja389978d67bc0...@mail.gmail.com... > > Hi all! > > > >

[PHP] Re: Design Patterns

2009-08-12 Thread Ralph Deffke
it would help if u would tell us what u want to accomplish with this ativity cheers ralph_def...@yahoo.de "Martin Scotta" wrote in message news:6445d94e0908121323x721254c4ja389978d67bc0...@mail.gmail.com... > Hi all! > > I've written a little Design Patterns Catalog in PHP. > The patterns where

[PHP] Design Patterns

2009-08-12 Thread Martin Scotta
Hi all! I've written a little Design Patterns Catalog in PHP. The patterns where taken from GoF: *Design Patterns: Elements of Reusable Object-Oriented Software* (ISBN 0-201-63361-2) This catalog includes (for each pattern): 1. gen

Re: [PHP] Re: Form Validation

2009-08-12 Thread Ralph Deffke
may I ask what JS list u are using? ""Micheleh Davis"" wrote in message news:003901ca1b6b$dd103d00$9730b7...@com... > Yep, I'm sorry, sent to the wrong one. Thanks all! > > > -Original Message- > From: Ralph Deffke [mailto:ralph_def...@yahoo.de] > Sent: Wednesday, August 12, 2009 12:29 P

RE: [PHP] Re: Form Validation

2009-08-12 Thread Micheleh Davis
Yep, I'm sorry, sent to the wrong one. Thanks all! -Original Message- From: Ralph Deffke [mailto:ralph_def...@yahoo.de] Sent: Wednesday, August 12, 2009 12:29 PM To: php-general@lists.php.net Subject: [PHP] Re: Form Validation this is a PHP mailing list, may be u ask this on a js mail

[PHP] Re: Form Validation

2009-08-12 Thread Ralph Deffke
this is a PHP mailing list, may be u ask this on a js mailinglist ralph_def...@yahoo.de ""Micheleh Davis"" wrote in message news:002901ca1b68$fc6b0020$f54100...@com... > Please help. My form validation worked fine until I added the terms check > at the bottom. Any ideas? > > > > //form valida

RE: [PHP] Re: Is select_db necessary?

2009-08-12 Thread Jay Blanchard
[snip] I'm interested to know why you consider this to be very flexible and how this leaves the selection in the database's hands? [/snip] Flexible because I can connect to more than one database on a server using one connection without having to re-issue a select_db command, especially in a code

Re: [PHP] Include Paths

2009-08-12 Thread Ralph Deffke
a rap song hihi haha best comment I've ever read on a mailing list. reminds me that live is fun thanks for making my day thanks sheridan for ur shakespear like abbilities thanks bastien for ur humor GREAT "Bastien Koert" wrote in message news:d7b6cab70908120909u593cbd6v692f34ae6ddea...@mail.g

Re: [PHP] Form Validation

2009-08-12 Thread Ashley Sheridan
On Wed, 2009-08-12 at 12:21 -0400, Micheleh Davis wrote: > Please help. My form validation worked fine until I added the terms check > at the bottom. Any ideas? > > > > //form validation step one > > function validateStep1(myForm){ > > // list of required fields > >

[PHP] Form Validation

2009-08-12 Thread Micheleh Davis
Please help. My form validation worked fine until I added the terms check at the bottom. Any ideas? //form validation step one function validateStep1(myForm){ // list of required fields with (myForm) { var requiredFields = ne

Re: [PHP] how to say "inverse your value" (to a boolean)?

2009-08-12 Thread Ralph Deffke
thats why I decided years ago to write myself a little bunch of classes for the html tags which gives me the ability to have PHP only code, very nice, no errors and my outputs dont even need Tidy pure XHTML i find these idear of mixing html and php as spagetty, using divs for tables as something w

Re: [PHP] Include Paths

2009-08-12 Thread Robert Cummings
Have you gone here: http://www.php.net/unsub.php Make sure you input the email address with which you registered: r...@duvals.ca It's really not very hard... my 10 month old baby could do it. Cheers, Rob. Rick Duval wrote: SORRY BUT I CAN'T GET OFF THIS LIST, I CAN'T GET OFF T

Re: [PHP] Include Paths

2009-08-12 Thread Bastien Koert
On Wed, Aug 12, 2009 at 12:06 PM, Ashley Sheridan wrote: > On Wed, 2009-08-12 at 12:03 -0400, Rick Duval wrote: >> SORRY BUT >> I CAN'T GET OFF THIS LIST, I CAN'T GET OFF THIS LIST, I CAN'T GET OFF THIS >> LIST >> I'VE TRIED. NO RESPONSE. IS THERE AN ADMIN OUT THERE? PLEASE GET ME >> OFF THIS

Re: [PHP] Re: Is select_db necessary?

2009-08-12 Thread Martin Scotta
On Wed, Aug 12, 2009 at 11:41 AM, Ralph Deffke wrote: > what are telling the logs on that code? > > > $link = mysql_connect( /* settings */); > mysql_select_db( 'database', $link); > $result = mysql_query( 'SELECT * FROM ', $link ); > $result = mysql_query( 'SELECT * FROM ', $link ); > $result =

Re: [PHP] Include Paths

2009-08-12 Thread Ashley Sheridan
On Wed, 2009-08-12 at 12:03 -0400, Rick Duval wrote: > SORRY BUT > I CAN'T GET OFF THIS LIST, I CAN'T GET OFF THIS LIST, I CAN'T GET OFF THIS > LIST > I'VE TRIED. NO RESPONSE. IS THERE AN ADMIN OUT THERE? PLEASE GET ME > OFF THIS LIST! > >

Re: [PHP] Include Paths

2009-08-12 Thread Rick Duval
SORRY BUT I CAN'T GET OFF THIS LIST, I CAN'T GET OFF THIS LIST, I CAN'T GET OFF THIS LIST I'VE TRIED. NO RESPONSE. IS THERE AN ADMIN OUT THERE? PLEASE GET ME OFF THIS LIST! This message has been scanned for viruses and dangerous content by A

Re: [PHP] Calendar Problem

2009-08-12 Thread Martin Scotta
On Wed, Aug 12, 2009 at 12:07 PM, tedd wrote: > At 9:50 AM -0500 8/12/09, Shawn McKenzie wrote: > >> tedd wrote: >> >>> >>> Your solution had 61 iterations (for loop) while mind had only 21, so >>> mine's a bit faster. Here's the comparison: >>> >>> http://php1.net/b/fridays/ >>> >>> But I'll

Re: [PHP] how to say "inverse your value" (to a boolean)?

2009-08-12 Thread tedd
At 8:33 AM -0700 8/12/09, Jim Lucas wrote: Daevid Vincent wrote: -snip- I side with Jim on this. I never use short tags and write similar crap. Jim said: I have found, in a number of cases, that using only the tag doesn't work all the time. It should work ALL the time, but sometimes inh

Re: [PHP] how to say "inverse your value" (to a boolean)?

2009-08-12 Thread Jim Lucas
Daevid Vincent wrote: > > >> -Original Message- >> Daevid Vincent wrote: >>> NO! For the love of God and all that is holy, don't do that >> accumulator / mod "hack". >>> That's so 1980's. And why make the CPU do all that math >> for every row... >>> Just do this. It's quick and si

[PHP] Re: [PHP-DEV] is there any way to get realpath cache hit ratio of php?

2009-08-12 Thread Stanislav Malyshev
Hi! Is there any way to get realpath cache hit ratio of php? Unfortunately not, it doesn't have API for statistics or looking into the cache. It would be a good idea to add one. -- Stanislav Malyshev, Zend Software Architect s...@zend.com http://www.zend.com/ (408)253-8829 MSN: s...@zen

Re: [PHP] Include Paths

2009-08-12 Thread Adam Shannon
On Wed, Aug 12, 2009 at 10:02 AM, Julian Muscat Doublesin < opensourc...@gmail.com> wrote: > I had a problem with the include and require paths when using AJAX. This I > have solved by using the document root. However since doing so I am > experiencing performance issues. Loading 20 records has su

Re: [PHP] Calendar Problem

2009-08-12 Thread tedd
At 9:50 AM -0500 8/12/09, Shawn McKenzie wrote: tedd wrote: Your solution had 61 iterations (for loop) while mind had only 21, so mine's a bit faster. Here's the comparison: http://php1.net/b/fridays/ But I'll use your solution -- it's more elegant. Thanks for the code, tedd Actual

Re: [PHP] Include Paths

2009-08-12 Thread Conor Mac Aoidh
Could you post some of the code that you have used. -- Conor http://conormacaoidh.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Include Paths

2009-08-12 Thread Julian Muscat Doublesin
I had a problem with the include and require paths when using AJAX. This I have solved by using the document root. However since doing so I am experiencing performance issues. Loading 20 records has suddenly turned into something of a matter of a minute rather then seconds. Has anyone ever experie

Re: [PHP] Calendar Problem

2009-08-12 Thread tedd
At 3:26 PM +0100 8/12/09, Stuart wrote: 2009/8/12 tedd : At 4:08 PM -0400 8/11/09, Robert Cummings wrote: I think Shawn McKenzie's is the best. It seems his would take at most 12 iterations. Cheers, Rob. Rob: For some reason I did not see/consider Shawn's solutions -- sorry Shawn.

Re: [PHP] Calendar Problem

2009-08-12 Thread Shawn McKenzie
tedd wrote: > > Your solution had 61 iterations (for loop) while mind had only 21, so > mine's a bit faster. Here's the comparison: > > http://php1.net/b/fridays/ > > But I'll use your solution -- it's more elegant. > > Thanks for the code, > > tedd > Actually, if you refresh your page you h

AW: [PHP] Re: Is select_db necessary?

2009-08-12 Thread Ralph Deffke
what are telling the logs on that code? ', $link ); $result = mysql_query( 'SELECT * FROM ', $link ); $result = mysql_query( 'SELECT * FROM ', $link ); $result = mysql_query( 'SELECT * FROM ', $link ); $result = mysql_query( 'SELECT * FROM ', $link ); $result = mysql_query( 'SELECT * FROM ', $link

Re: [PHP] Re: Is select_db necessary?

2009-08-12 Thread Ralph Deffke
as i said earlier: on db level there is always al select db done, doing this on higer level layers (the database extension) consumes time. or why do extension have the two ways of functions? to make our live more difficult? on a ANSI sql the sql interpreter time is increased! unnessarylie ralph_d

Re: [PHP] Calendar Problem

2009-08-12 Thread tedd
At 11:03 AM -0300 8/12/09, Martin Scotta wrote: Hi all This is my point of view. I try to stay the most legible and simple as possible. @tedd: can you benchmark this script too? usualy legibility > performance Martin: It's included here: http://php1.net/b/fridays/ Works great -- thanks.

Re: [PHP] Calendar Problem

2009-08-12 Thread Stuart
2009/8/12 tedd : >>> At 4:08 PM -0400 8/11/09, Robert Cummings wrote: >> >> I think Shawn McKenzie's is the best. It seems his would take at most 12 >> iterations. >> >> Cheers, >> Rob. > > Rob: > > For some reason I did not see/consider Shawn's solutions -- sorry Shawn. > > However, it appears tha

Re: [PHP] Re: Is select_db necessary?

2009-08-12 Thread Martin Scotta
Wed, Aug 12, 2009 at 10:37 AM, Ralph Deffke wrote: > I agree totally, are we not dicussing speed issues all the time? and then > we > recommend a code doing an unessesary job on every call? > > an ANSI selct db in the sql forces any database to run the internal select > db because there would be

Re: [PHP] Calendar Problem

2009-08-12 Thread Martin Scotta
On Wed, Aug 12, 2009 at 10:25 AM, Robert Cummings wrote: > > > tedd wrote: > >> At 4:08 PM -0400 8/11/09, Robert Cummings wrote: >> >>> tedd wrote: >>> Hi gang: I want to show the dates for all Fridays +-30 days from a specific date. For example, given today's date (8/11/2

Re: [PHP] Calendar Problem

2009-08-12 Thread tedd
At 4:08 PM -0400 8/11/09, Robert Cummings wrote: I think Shawn McKenzie's is the best. It seems his would take at most 12 iterations. Cheers, Rob. Rob: For some reason I did not see/consider Shawn's solutions -- sorry Shawn. However, it appears that mine is still the fastest in most test.

[PHP] Re: Is select_db necessary?

2009-08-12 Thread Ralph Deffke
I agree totally, are we not dicussing speed issues all the time? and then we recommend a code doing an unessesary job on every call? an ANSI selct db in the sql forces any database to run the internal select db because there would be no check if the databse is the current one. because, databasedev

Re: [PHP] Is select_db necessary?

2009-08-12 Thread Ralph Deffke
here a basic background to this question. all databases are build from various module bases. one module is the database itself prosessing eg. the sql's another module is the database connectivity. e.g. mySQL has a ability to connect thru ADO, .NET and an server via IP. MySQL supports unlimited da

[PHP] Re: Is select_db necessary?

2009-08-12 Thread Colin Guthrie
'Twas brillig, and Jay Blanchard at 12/08/09 13:53 did gyre and gimble: Jay Blanchard wrote: SELECT a.foo, a.bar FROM myDatabase.myTable a WHERE you set other conditions here All that is required is that you establish a connection to a server. If I recall correctly, this will cause issues wit

Re: [PHP] Calendar Problem

2009-08-12 Thread Robert Cummings
tedd wrote: At 4:08 PM -0400 8/11/09, Robert Cummings wrote: tedd wrote: Hi gang: I want to show the dates for all Fridays +-30 days from a specific date. For example, given today's date (8/11/2009) the Fridays that fall +-30 days are July 17, July 24, July 31, Aug 7, Aug 14, Aug 21, Aug

Re: [PHP] Calendar Problem

2009-08-12 Thread tedd
At 4:08 PM -0400 8/11/09, Robert Cummings wrote: tedd wrote: Hi gang: I want to show the dates for all Fridays +-30 days from a specific date. For example, given today's date (8/11/2009) the Fridays that fall +-30 days are July 17, July 24, July 31, Aug 7, Aug 14, Aug 21, Aug 28, and Sept 4.

RE: [PHP] Is select_db necessary?

2009-08-12 Thread Jay Blanchard
[snip] Jay Blanchard wrote: > [snip] > Is the database selection necessary, or is that implied with a SELECT or > other SQL command? > [/snip] > > It depends on the database (as you have seen in many of the responses), > but there is a way to keep from doing this if the database is ANSI > complian

Re: [PHP] Is select_db necessary?

2009-08-12 Thread Robert Cummings
Jay Blanchard wrote: [snip] Is the database selection necessary, or is that implied with a SELECT or other SQL command? [/snip] It depends on the database (as you have seen in many of the responses), but there is a way to keep from doing this if the database is ANSI compliant using proper SQL sy

Re: [PHP] Is select_db necessary?

2009-08-12 Thread Floyd Resler
mysql_select_db is not necessary but it does make writing queries easier since you don't have to specify which database in each query. Take care, Floyd On Aug 11, 2009, at 11:23 PM, Allen McCabe wrote: I have seen different scripts for working with SQL, and most follow the same method wit

RE: [PHP] Is select_db necessary?

2009-08-12 Thread Jay Blanchard
[snip] Is the database selection necessary, or is that implied with a SELECT or other SQL command? [/snip] It depends on the database (as you have seen in many of the responses), but there is a way to keep from doing this if the database is ANSI compliant using proper SQL syntax; SELECT a.foo, a.

Re: [PHP] Is select_db necessary?

2009-08-12 Thread Tony Marston
"PJ" wrote in message news:4a82aa58.2020...@videotron.ca... > Paul M Foster wrote: >> On Tue, Aug 11, 2009 at 08:23:21PM -0700, Allen McCabe wrote: >> >> >>> I have seen different scripts for working with SQL, and most follow the >>> same >>> method with on difference. >>> >>> Variables are def

Re: [PHP] Is select_db necessary?

2009-08-12 Thread PJ
Paul M Foster wrote: > On Tue, Aug 11, 2009 at 08:23:21PM -0700, Allen McCabe wrote: > > >> I have seen different scripts for working with SQL, and most follow the same >> method with on difference. >> >> Variables are defined (host, password, etc.) >> mysql_connect command >> >> //then, the dif

Re: [PHP] Embedding foreach loops

2009-08-12 Thread Ashley Sheridan
On Tue, 2009-08-11 at 16:23 -0400, Rick Duval wrote: > OK, first guys, I'm sorry to have to do this but I can't get off this list!!! > > I've followed the instructions on a couple of occasions (the ones at > the bottom of every email): > > PHP General Mailing List (http://www.php.net/) > > To unsu

Re: [PHP] Embedding foreach loops

2009-08-12 Thread Ashley Sheridan
On Tue, 2009-08-11 at 16:00 -0400, Eddie Drapkin wrote: > On Tue, Aug 11, 2009 at 3:56 PM, tedd wrote: > > At 12:44 PM -0700 8/11/09, Ben Dunlap wrote: > >> > >> This is probably flame-war tinder, so I'll try to tread more delicately in > >> the future. Next you know we'll be on the ternary operato

Re: [PHP] Is select_db necessary?

2009-08-12 Thread Tony Marston
"Paul M Foster" wrote in message news:20090812035618.gd2...@quillandmouse.com... > On Tue, Aug 11, 2009 at 08:23:21PM -0700, Allen McCabe wrote: > >> I have seen different scripts for working with SQL, and most follow the >> same >> method with on difference. >> >> Variables are defined (host,