Re: [PHP] Join question

2007-11-30 Thread chris smith
On Dec 1, 2007 3:53 PM, Crayon Shin Chan <[EMAIL PROTECTED]> wrote:
> On Saturday 01 December 2007, tedd wrote:
> > At 10:21 AM +0800 11/30/07, Crayon Shin Chan wrote:
> > >On Friday 30 November 2007, tedd wrote:
> > >>  I'm trying to understand joins,
> > >
> > >Ask on a database related list.
>
> > Really?
>
> Really.

Considering the rest of the off-topic questions that regularly get
asked on this list it's a bit much to single out this one particular
post.

javascript, css, html - none is directly related to php but all still
get asked here (and 99% of the time answered) - I don't know why
you're making such a big deal about this particular post and haven't
kicked up a fuss about the rest in the past.

-- 
Postgresql & php tutorials
http://www.designmagick.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Join question

2007-11-30 Thread Andrés Robinet
> -Original Message-
> From: tedd [mailto:[EMAIL PROTECTED]
> Sent: Saturday, December 01, 2007 2:09 AM
> To: Crayon Shin Chan; php-general@lists.php.net
> Subject: Re: [PHP] Join question
> 
> At 12:53 PM +0800 12/1/07, Crayon Shin Chan wrote:
> >On Saturday 01 December 2007, tedd wrote:
> >>  At 10:21 AM +0800 11/30/07, Crayon Shin Chan wrote:
> >>  >On Friday 30 November 2007, tedd wrote:
> >>  >>  I'm trying to understand joins,
> >>  >
> >>  >Ask on a database related list.
> >
> >>  Really?
> >
> >Really.
> >
> >>  No language lives in a vacuum, mate. Especially, a web language.
> >
> >If you try you can probably make a connection from php to everything
> under
> >the sun, doesn't mean everything under the sun is an appropriate topic
> >for this list.
> >
> >>  So, I'll continue to post MySQL questions on this list because I
> >>  think it's appropriate.
> >
> >You ought to know by now that there is the php-db list. Even so your
> >question doesn't belong even there because it has zilch to do with
> php,
> >but it is still slightly more appropriate to post there than here.
> 
> Well said.
> 
> Cheers,
> 
> tedd
> 
> (that should confuse the post-police for a while).
> 
> --
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

I can only say as someone over here said once...

"Do not enter into the world of drugs. We are too many and there's not
enough for everyone" (Les Luthiers) lol

Rob

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Join question

2007-11-30 Thread tedd

At 12:53 PM +0800 12/1/07, Crayon Shin Chan wrote:

On Saturday 01 December 2007, tedd wrote:

 At 10:21 AM +0800 11/30/07, Crayon Shin Chan wrote:
 >On Friday 30 November 2007, tedd wrote:
 >>  I'm trying to understand joins,
 >
 >Ask on a database related list.



 Really?


Really.


 No language lives in a vacuum, mate. Especially, a web language.


If you try you can probably make a connection from php to everything under
the sun, doesn't mean everything under the sun is an appropriate topic
for this list.


 So, I'll continue to post MySQL questions on this list because I
 think it's appropriate.


You ought to know by now that there is the php-db list. Even so your
question doesn't belong even there because it has zilch to do with php,
but it is still slightly more appropriate to post there than here.


Well said.

Cheers,

tedd

(that should confuse the post-police for a while).

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Join question

2007-11-30 Thread Jay Blanchard
[snip]
If you try you can probably make a connection from php to everything
under 
the sun, doesn't mean everything under the sun is an appropriate topic 
for this list.
[/snip]

The Oracle of PHP - 6 Degrees of Separation 

I joined PHP to Oracle, Kevin Bacon and temperature all in one shot. 

Tedd, what did you want to know about joins?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Join question

2007-11-30 Thread Crayon Shin Chan
On Friday 30 November 2007, Jochem Maas wrote:

> my guess it took less time to search for 'Crayon' in his mail archive
> than it took you to write the sentence.

Is not so much the actual time taken but rather that he had the free time 
at all.

> aparently Rob wasn't saying this ... but I would, regardless the OP
> (tedd) has earned his keep so to speak (and probably taken more shit
> than you in the process without resorting to troll-like behaviour) -
> this is proved by the fact that people like Rob are helping him with
> something that is not strictly on topic.

So let me get this straight, only paid up members of the old boys club are 
allowed to make off-topic posts? The rest can lump it?

> besides which it's rather pointless telling someone to go elsewhere for
> help when they already got the help and posted that they had solved the
> problem.

That's for future reference.

-- 
Crayon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Join question

2007-11-30 Thread Crayon Shin Chan
On Friday 30 November 2007, Robert Cummings wrote:

> I'm sorry, allow me to rephrase... in the past 5 months you've made 2
> on-topic useful posts, with the rest either being on-topic for an
> off-topic thread, or completely off-topic. I see no point in saying
> more, I've made my point.

I know your drill by now - make wild generalised accusations without 
substance then say you've made your point.

-- 
Crayon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Join question

2007-11-30 Thread Crayon Shin Chan
On Saturday 01 December 2007, tedd wrote:
> At 10:21 AM +0800 11/30/07, Crayon Shin Chan wrote:
> >On Friday 30 November 2007, tedd wrote:
> >>  I'm trying to understand joins,
> >
> >Ask on a database related list.

> Really?

Really.

> No language lives in a vacuum, mate. Especially, a web language.

If you try you can probably make a connection from php to everything under 
the sun, doesn't mean everything under the sun is an appropriate topic 
for this list.

> So, I'll continue to post MySQL questions on this list because I
> think it's appropriate. 

You ought to know by now that there is the php-db list. Even so your 
question doesn't belong even there because it has zilch to do with php, 
but it is still slightly more appropriate to post there than here.

-- 
Crayon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Join question

2007-11-30 Thread tedd

At 10:21 AM +0800 11/30/07, Crayon Shin Chan wrote:

On Friday 30 November 2007, tedd wrote:

 I'm trying to understand joins,


Ask on a database related list.

--
Crayon


Really?

No language lives in a vacuum, mate. Especially, a web language.

IMO, one of the major attributes that make PHP truly great is MySQL. 
Over the years I've programmed in more languages than I can remember 
(including rocks), but never did I find a language that so easily 
integrated with a dB -- and that rocks, even if you don't realize it.


So, I'll continue to post MySQL questions on this list because I 
think it's appropriate. I always include some mention/hint in the 
subject line as to the topic. So, if you see that it's a MySQL 
related question and you can't provide an answer, then you can pass 
and let others teach/learn without the noise.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Join question [solved]

2007-11-30 Thread tedd

At 9:52 AM -0500 11/30/07, Daniel Brown wrote:

On Nov 29, 2007 11:17 PM, Robert Cummings <[EMAIL PROTECTED]> wrote:

Rob,

The version difference is probably right on the nose.  If I
remember correctly, you couldn't do that in the long-popular 3.23,
which *gasp!* is still used by some web hosts, believe it or not.

--
Daniel P. Brown


Bingo!

You guys know you're stuff.

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Join question [solved]

2007-11-30 Thread tedd

At 2:00 PM +1100 11/30/07, Chris wrote:

Out of curiosity, what SQL server (and version) are you using? I
currently have MySQL 5.0.33 on my dev box and I had no problem with the
query I gave you. Perhaps it's a version issue. There really shouldn't
be a problem updating a table that also occurs in the select query since
the select query should take place before the insert.


He wasn't doing an insert/select, he was doing an update with two 
tables joined together.




I thought that --

UPDATE user1 u1, user2 u2
SET u1.login = u2.login, u1.password = u2.password
WHERE u1.username = u2.username

-- would work, but it don't.



Yes, that was true. But considering that it no longer worked, I moved 
on. I still have no clue as to why four months ago the code ran and 
now it doesn't -- other than the host upgraded. But, I don't see how 
that could have affected things.


As for MySQL version, it's now 3.23.58 -- but I don't know what it 
was before the upgrade -- could have been the same. I dunno.


Thanks for the interest.

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Calling parent function with call_user_func_array

2007-11-30 Thread Tommy Baggett
Thanks for the great advice!  That did the trick and made me realize  
an even simpler solution to my needs in the process.


I needed to iterate the pages in reverse to store the page ID of the  
last  element of each  element before allowing the walker  
class to do its work.  This allowed me to assign a CSS class to the  
stored elements in the Walker class's start_el function.


Both you guys have a great weekend and thanks for the help.

On Nov 29, 2007, at 6:56 PM, Nathan Nobbe wrote:

wow; i was just looking at the wordpress source;  not the prettiest  
code ive

ever seen..
anyway; in what context do you intend to use the subclass?  why  
dont you

just create a
proxy instead?
eg. (php4)

class WalkerProxy {
var $walkerInstance = null;

/**
 * constructor
 *   accept an existing walker instance or create one from scratch
 */
function WalkerProxy($existingWalker=null) {
if(!is_null($existingWalker) && is_a($existingWalker,  
'Walker') {

$this->walkerInstance = $existingWalker;
} else {
$this->walkerInstance = new Walker();
}
}

/**
 * walk
 *do custom WalkerProxy stuff then invoke the underlying  
Walker's

walk() method
 */
function walk($elements, $to_depth) {
  do something custom here
return $this->walkerInstance($elements, $to_depth);
}

   /// .
}

-nathan


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



php-general@lists.php.net

2007-11-30 Thread Stephen Edberg
On Sat, 1 Dec 2007, Andrei Verovski (aka MacGuru) wrote:

> Hi !
>
> Anyone knows PHP/AJAX library which allows to get full path of file dropped
> into web browser's window area?
>
> It is required for document archiving system in order to avoid multiple (or to
> be more precise, almost endless) usage of "open file" dialogs from the
> browser.
>
> Library should be compatible with Firefox (Lin, Win, Mac), IE and Safary.
>
>
> Thanks in advance for any suggestion(s).
>
> Andrei
>


As others have noted, Javascript cannot return the full path to a
client-side document for security reasons. If you need a multiple file
upload interface, you might want to take a look at some extjs ALAX
toolkit-based stuff, eg

http://aariadne.com/uploadform/
http://extplorer.sourceforge.net/

Haven't used either of them, though. I do use extjs alot:

http://extjs.com/

Normally I shy away from 'Web 2.0' kinda stuff, but I've had to develop
some complex dynamic interfaces to a PHP/MySQL backend and had to make the
leap. It's well-documented, the developers are active and helpful
participants in the forums, and it seems to work pretty well
cross-platform (haven't tried it on my Linux/Solaris boxes yet, but
WinXP/Firefox, WinXP/IE, OSX/Firefox, OSX/Safari all seem to work pretty
well. Had some quirks with OSX/Opera, but haven't had a chance to delve
into that.

I also use the HTML_AJAX package -

http://pear.php.net/package/HTML_AJAX

- as I still have some PHP4 left and can't use the native JSON functions.

If extjs doesn't float your boat, you can always look into Scriptaculous,
Dojo, YUI, many others.

steve

...
. Steve Edberg   [EMAIL PROTECTED] .
. Computer Consultant University of California, Davis .
.   (530)754-9127 .
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



php-general@lists.php.net

2007-11-30 Thread Andrés Robinet
You can also use the FileReference ActionScript class in flash. This will
not allow you to drop a file and get it uploaded (will it?) but it supports
multiple file selection. There are some implementations in javascript that
make use of this flash feature to upload multiple files interactively
(search for SWFUpload in google, but there are others as well).
But surely enough... if you require such a thing as drag and drop for files
your best bet is a Java Applet.

Rob
> -Original Message-
> From: Dan [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 30, 2007 9:40 PM
> To: php-general@lists.php.net
> Subject: [PHP] Re: PHP/AJAX File Drag&Drop
> 
> Unfortunatly javascript can't access the filesystem so it can't get
> filenames.  The closest way you could do something like this would be
> to use
> Java (not javascript, totally different).  It's a permissions thing,
> just
> the way JS and everything else is designed.
> 
> - Dan
> 
> ""Andrei Verovski (aka MacGuru)"" <[EMAIL PROTECTED]> wrote in
> message
> news:[EMAIL PROTECTED]
> > Hi !
> >
> > Anyone knows PHP/AJAX library which allows to get full path of file
> > dropped
> > into web browser's window area?
> >
> > It is required for document archiving system in order to avoid
> multiple
> > (or to
> > be more precise, almost endless) usage of "open file" dialogs from
> the
> > browser.
> >
> > Library should be compatible with Firefox (Lin, Win, Mac), IE and
> Safary.
> >
> >
> > Thanks in advance for any suggestion(s).
> >
> > Andrei
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



php-general@lists.php.net

2007-11-30 Thread Warren Vail
I think the risk is that the path shows lots of information about how your
system is configured that is not necessary to transfer the file, so, for
example if uploading something from you My Documents folder on windoz, why
reveal what username you use for system signon, no sense leaving the door
open.

I would suggest you use something like a signed on user name to your site to
organize uploads, and not depend on where a given user stores things on his
system.

Warren Vail

> -Original Message-
> From: Dan [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 30, 2007 4:40 PM
> To: php-general@lists.php.net
> Subject: [PHP] Re: PHP/AJAX File Drag&Drop
> 
> Unfortunatly javascript can't access the filesystem so it can't get
> filenames.  The closest way you could do something like this would be to
> use
> Java (not javascript, totally different).  It's a permissions thing, just
> the way JS and everything else is designed.
> 
> - Dan
> 
> ""Andrei Verovski (aka MacGuru)"" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi !
> >
> > Anyone knows PHP/AJAX library which allows to get full path of file
> > dropped
> > into web browser's window area?
> >
> > It is required for document archiving system in order to avoid multiple
> > (or to
> > be more precise, almost endless) usage of "open file" dialogs from the
> > browser.
> >
> > Library should be compatible with Firefox (Lin, Win, Mac), IE and
> Safary.
> >
> >
> > Thanks in advance for any suggestion(s).
> >
> > Andrei
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



php-general@lists.php.net

2007-11-30 Thread Dan
Unfortunatly javascript can't access the filesystem so it can't get 
filenames.  The closest way you could do something like this would be to use 
Java (not javascript, totally different).  It's a permissions thing, just 
the way JS and everything else is designed.


- Dan

""Andrei Verovski (aka MacGuru)"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

Hi !

Anyone knows PHP/AJAX library which allows to get full path of file 
dropped

into web browser's window area?

It is required for document archiving system in order to avoid multiple 
(or to

be more precise, almost endless) usage of "open file" dialogs from the
browser.

Library should be compatible with Firefox (Lin, Win, Mac), IE and Safary.


Thanks in advance for any suggestion(s).

Andrei 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Before to submission RFC datas

2007-11-30 Thread Jochem Maas
Andrés Robinet wrote:
>> -Original Message-
>> From: Norde-Amijkzegl Tomas [mailto:[EMAIL PROTECTED]
>> Sent: Friday, November 30, 2007 8:16 PM
>> To: php-general@lists.php.net
>> Subject: [PHP] Before to submission RFC datas
>>
>>
>>
>> All of yous people, hi!
>>
>> I seeing yesterday on the Googles for RFC 0001 so I asking
>> you to enforce you helping My head from pain before I submissioning
>> the Officials.
>>
>> For before to submission RFC Datas to Ietf on List Proposals, I asking
>> much discussionality by Community.  I proposing smartly and goodly
>> writed
>> RFC for banishment of Nigger peoples from internet in countries where
>> no internet for exist!!  If not by other Webs then by ASP PHP Java and
>> mores for Technologie it is so yesness?  Rightly I am knowing and You
>> welcome to be expected for helping this Me.  I not paying for You
>> works.
>> Is beautiful for Open Source works like I giving back for some future
>> year
>> when not for looking Microsoft.  I know you thinking Fucking Microsofts
>> like Me for.  Yes.
>>
>> For stopping access of internet for some peoples, less fraud coming
>> from
>> Nigeria, yes?  Banishing for ever maybe Great possibility but not
>> needing.
>> Probably most long for be 1 year.  Then review for allowed back
>> accessing.
>>
>> Why me?  I having credit cardage stolen Informations on the Online
>> place
>> from Nigeria like a lots many peoples.  So for stopping they are from
>> accessing Internet like life is for stopping them steal You
>> Informations
>> from pants like Me.
>>
>> Never I writing RFC before now time, so You are going to help Me for do
>> that right now while I sleep.
>>
>> What I doing for submission this RFC Datas like PHP?  You putting all
>> John
>> Handcock
>> (hi to American Friends! ;-) ) which is being You name on a Petition.
>> I not
>> paying.  For true?
>>
>> Byes while You write to Me!!
>>
>> Yes.
>>
>> -Tomas
>>
>> --
>> View this message in context: http://www.nabble.com/Before-to-
>> submission-RFC-datas-tf4925553.html#a14097130
>> Sent from the PHP - General mailing list archive at Nabble.com.
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> As a spanish speaker I can hardly understand this... What's this? This
> sounds like "Me be native this land boss, wild wild west, move away cowboy".
> No offense... but... Can someoune explain it?

either it's someone whose dropped one too many tabs of LSD or someone
who is trying and failing to be funny. either way you can safely ignore it.

these are not the droids we're looking for. ;-)

> 
> Rob
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Hellos?

2007-11-30 Thread Norde-Amijkzegl Tomas

I for getting You helps on this Important Question?  RFC do not write itselfs
for Onlines.

Fastly responsing me for stopping accessing by make Law for RFC.  Then
Internet President stopping all accessing from Nigeria right soon.  Yes!

No more stolens of Identities and Passwords.  No more stolens of Credit
Cardings.  No more cryings.  No more Wifes leaving because You poor from
stolens of every Coin like Me have!!

What they doing?  Inventing Internet for only Nigeria their own?  I Laugh!!

Responsing Me now for help Me get RFC becomes Law.  Together we Friends stop
stolens life!!  Take back Your breath!!

Yes.

-Tomas
-- 
View this message in context: 
http://www.nabble.com/Hellos--tf4926170.html#a14099278
Sent from the PHP - General mailing list archive at Nabble.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Before to submission RFC datas

2007-11-30 Thread Andrés Robinet
> -Original Message-
> From: Norde-Amijkzegl Tomas [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 30, 2007 8:16 PM
> To: php-general@lists.php.net
> Subject: [PHP] Before to submission RFC datas
> 
> 
> 
> All of yous people, hi!
> 
> I seeing yesterday on the Googles for RFC 0001 so I asking
> you to enforce you helping My head from pain before I submissioning
> the Officials.
> 
> For before to submission RFC Datas to Ietf on List Proposals, I asking
> much discussionality by Community.  I proposing smartly and goodly
> writed
> RFC for banishment of Nigger peoples from internet in countries where
> no internet for exist!!  If not by other Webs then by ASP PHP Java and
> mores for Technologie it is so yesness?  Rightly I am knowing and You
> welcome to be expected for helping this Me.  I not paying for You
> works.
> Is beautiful for Open Source works like I giving back for some future
> year
> when not for looking Microsoft.  I know you thinking Fucking Microsofts
> like Me for.  Yes.
> 
> For stopping access of internet for some peoples, less fraud coming
> from
> Nigeria, yes?  Banishing for ever maybe Great possibility but not
> needing.
> Probably most long for be 1 year.  Then review for allowed back
> accessing.
> 
> Why me?  I having credit cardage stolen Informations on the Online
> place
> from Nigeria like a lots many peoples.  So for stopping they are from
> accessing Internet like life is for stopping them steal You
> Informations
> from pants like Me.
> 
> Never I writing RFC before now time, so You are going to help Me for do
> that right now while I sleep.
> 
> What I doing for submission this RFC Datas like PHP?  You putting all
> John
> Handcock
> (hi to American Friends! ;-) ) which is being You name on a Petition.
> I not
> paying.  For true?
> 
> Byes while You write to Me!!
> 
> Yes.
> 
> -Tomas
> 
> --
> View this message in context: http://www.nabble.com/Before-to-
> submission-RFC-datas-tf4925553.html#a14097130
> Sent from the PHP - General mailing list archive at Nabble.com.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

As a spanish speaker I can hardly understand this... What's this? This
sounds like "Me be native this land boss, wild wild west, move away cowboy".
No offense... but... Can someoune explain it?

Rob

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Why You doing no talks?

2007-11-30 Thread Norde-Amijkzegl Tomas

You normal responsing fastly, why not for Important Questions like I did for
post?

You must respond Me now so I can write RFC for stopping they accessing
Online right now!  Make no more days come!

Yes.

-Tomas
-- 
View this message in context: 
http://www.nabble.com/Why-You-doing-no-talks--tf4925962.html#a14098657
Sent from the PHP - General mailing list archive at Nabble.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: how do i get a printout of original multipart post data

2007-11-30 Thread Dan
""Olav Mørkrid"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

hello


how can i get a raw and untouched printout of a multipart/form-data
POST? i need this to analyze what certain user agents do wrong when
uploading files.

what happens is that php just fails to put files into $_FILES, and
gives no way of seeing the original posting and exactly what is wrong
with it.

according to the manual, neither "always_populate_raw_post_data" nor
 work for multipart/form-data.


Go get Ethereal http://www.ethereal.com/ start the program, set which 
network card you want to use (you probably only have one), start capture. 
You'll now see all the packets going down the wire.  Go ahead and do the 
post and you'll be able to see the post data.


- Dan 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Before to submission RFC datas

2007-11-30 Thread Norde-Amijkzegl Tomas


All of yous people, hi!

I seeing yesterday on the Googles for RFC 0001 so I asking
you to enforce you helping My head from pain before I submissioning
the Officials.

For before to submission RFC Datas to Ietf on List Proposals, I asking
much discussionality by Community.  I proposing smartly and goodly writed
RFC for banishment of Nigger peoples from internet in countries where
no internet for exist!!  If not by other Webs then by ASP PHP Java and
mores for Technologie it is so yesness?  Rightly I am knowing and You
welcome to be expected for helping this Me.  I not paying for You works.
Is beautiful for Open Source works like I giving back for some future year
when not for looking Microsoft.  I know you thinking Fucking Microsofts
like Me for.  Yes.

For stopping access of internet for some peoples, less fraud coming from
Nigeria, yes?  Banishing for ever maybe Great possibility but not needing.
Probably most long for be 1 year.  Then review for allowed back accessing.

Why me?  I having credit cardage stolen Informations on the Online place
from Nigeria like a lots many peoples.  So for stopping they are from
accessing Internet like life is for stopping them steal You Informations
from pants like Me.

Never I writing RFC before now time, so You are going to help Me for do
that right now while I sleep.

What I doing for submission this RFC Datas like PHP?  You putting all John
Handcock
(hi to American Friends! ;-) ) which is being You name on a Petition.  I not
paying.  For true?

Byes while You write to Me!!

Yes.

-Tomas

-- 
View this message in context: 
http://www.nabble.com/Before-to-submission-RFC-datas-tf4925553.html#a14097130
Sent from the PHP - General mailing list archive at Nabble.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



php-general@lists.php.net

2007-11-30 Thread Andrei Verovski (aka MacGuru)
Hi !

Anyone knows PHP/AJAX library which allows to get full path of file dropped 
into web browser's window area?

It is required for document archiving system in order to avoid multiple (or to 
be more precise, almost endless) usage of "open file" dialogs from the 
browser.

Library should be compatible with Firefox (Lin, Win, Mac), IE and Safary.


Thanks in advance for any suggestion(s).

Andrei

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] including parenthesis, space and dashes in a phone number

2007-11-30 Thread Warren Vail

> 
> quite, quite, I was just jesting :-)
> 

Oh good, I'll call back the troups,,

Warren

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Calling a stored procedure

2007-11-30 Thread Daniel Brown
On Nov 30, 2007 5:16 PM, Dan Shirah <[EMAIL PROTECTED]> wrote:
> ALMOST have it!
>
> I have changed the code to this:
>
> if ($num_rows > 0 && $barcode_id == "") {
>  echo "The query found ".$num_rows." row(s)";
>  $procedure = "Execute Procedure informix.updt_brcd_id_req('$case',
> '$event_date', '$event_sequence', '$event_code')";
> print_r ($procedure);
>  $run = ifx_query($procedure, $connect_id);
>  }
>
> When I submit the form it gives me this error: PHP Warning: ifx_query() [
> function.ifx-query ]:
> Execute immediate fails
>
> BUT!!!   The stored procedure still runs and updates my data correctly.
>
> Any ideas what might be throwing that error and how to get rid of it?
>
> Thanks!
> Dan

To silence the error (which isn't fixing it, just shutting it up)
just add a @ before the function call.

 0 && $barcode_id == "") {
 echo "The query found ".$num_rows." row(s)";
 $procedure = "Execute Procedure informix.updt_brcd_id_req('$case',
'$event_date', '$event_sequence', '$event_code')";
print_r ($procedure);
 $run = @ifx_query($procedure, $connect_id);
 }
?>

Again, that won't fix it, but it will shut it up.  Though ignoring
warnings is never considered a Good Idea[tm].

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] including parenthesis, space and dashes in a phone number

2007-11-30 Thread Jochem Maas
Warren Vail wrote:
> I did not know that about Windows Letter formatting, well, not all Americans
> think everything revolves around the way Americans do things.  Knowing a
> little about Microsoft marketing strategy, they probably feel they should
> charge extra for providing more flexible formatting.
> 
> I do believe a good site designer, will plan for a global market, instead of
> a local US one, even if others fail to share his vision.

quite, quite, I was just jesting :-)

> 
> Warren
> 
>> -Original Message-
>> From: Jochem Maas [mailto:[EMAIL PROTECTED]
>> Sent: Friday, November 30, 2007 1:57 PM
>> To: Warren Vail
>> Cc: 'afan pasalic'; 'Daevid Vincent'; 'php-general'
>> Subject: Re: [PHP] including parenthesis, space and dashes in a phone
>> number
>>
>> Warren Vail wrote:
>>> Not to mention that syntax works in the US, but not large portions of
>> the
>>> rest of the world.  (even with the 1 country code in front).
>> can't remember when that ever stopped an american.
>>
>> e.g. Windows print subsystem that shoves 'Letter' format down
>> your throat as the default even though the OS knows damn well I'm
>> using a european locale.
>>
>>> Warren vail
>>>
 -Original Message-
 From: afan pasalic [mailto:[EMAIL PROTECTED]
 Sent: Friday, November 30, 2007 12:03 PM
 To: Daevid Vincent
 Cc: 'php-general'
 Subject: Re: [PHP] including parenthesis, space and dashes in a phone
 number

 It's ok to store it this way, but it could be a little PITA when
>> search.
 E.g., you store (123) 456-7890 and somebody search for 123-456-7890?
 Right?

 -afan



 Daevid Vincent wrote:
> The kind of opposite of this, is what I use, in that it ADDs the ()
>> and
 -
> if ((strlen($phone)) <= 14) $phone =
> preg_replace("/[^0-9]*([0-9]{3})[^0-9]*([0-9]{3})[^0-9]*([0-
>> 9]{4}).*/",
> "(\\1) \\2-\\3", $phone);
>
>> -Original Message-
>> From: afan pasalic [mailto:[EMAIL PROTECTED]
>> Sent: Friday, November 30, 2007 5:45 AM
>> To: php-general
>> Subject: [PHP] excluding parenthesis, space and dashes from
>> phone number
>>
>> hi,
>> I store phone number in mysql as integer, e.g. (123) 456-7890
>> is stored
>> as 1234567890.
>> though, in search form they usually type in a phone number with
>> parenthesis/space/dashes. I have to extract numbers before I search
>> through mysql.
>>
>> currently, I use eregi_replace() function, several times, to
>> do the job:
>> eregi_replace(' ', '', $phone);
>> eregi_replace('(', '', $phone);
>> eregi_replace(')', '', $phone);
>> eregi_replace('-', '', $phone);
>> and it works fine.
>>
>> but, is there any better way? more "fancy"? :)
>>
>> thanks for any help.
>>
>> -afan
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] including parenthesis, space and dashes in a phone number

2007-11-30 Thread Warren Vail
I did not know that about Windows Letter formatting, well, not all Americans
think everything revolves around the way Americans do things.  Knowing a
little about Microsoft marketing strategy, they probably feel they should
charge extra for providing more flexible formatting.

I do believe a good site designer, will plan for a global market, instead of
a local US one, even if others fail to share his vision.

Warren

> -Original Message-
> From: Jochem Maas [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 30, 2007 1:57 PM
> To: Warren Vail
> Cc: 'afan pasalic'; 'Daevid Vincent'; 'php-general'
> Subject: Re: [PHP] including parenthesis, space and dashes in a phone
> number
> 
> Warren Vail wrote:
> > Not to mention that syntax works in the US, but not large portions of
> the
> > rest of the world.  (even with the 1 country code in front).
> 
> can't remember when that ever stopped an american.
> 
> e.g. Windows print subsystem that shoves 'Letter' format down
> your throat as the default even though the OS knows damn well I'm
> using a european locale.
> 
> >
> > Warren vail
> >
> >> -Original Message-
> >> From: afan pasalic [mailto:[EMAIL PROTECTED]
> >> Sent: Friday, November 30, 2007 12:03 PM
> >> To: Daevid Vincent
> >> Cc: 'php-general'
> >> Subject: Re: [PHP] including parenthesis, space and dashes in a phone
> >> number
> >>
> >> It's ok to store it this way, but it could be a little PITA when
> search.
> >> E.g., you store (123) 456-7890 and somebody search for 123-456-7890?
> >> Right?
> >>
> >> -afan
> >>
> >>
> >>
> >> Daevid Vincent wrote:
> >>> The kind of opposite of this, is what I use, in that it ADDs the ()
> and
> >> -
> >>> if ((strlen($phone)) <= 14) $phone =
> >>> preg_replace("/[^0-9]*([0-9]{3})[^0-9]*([0-9]{3})[^0-9]*([0-
> 9]{4}).*/",
> >>> "(\\1) \\2-\\3", $phone);
> >>>
>  -Original Message-
>  From: afan pasalic [mailto:[EMAIL PROTECTED]
>  Sent: Friday, November 30, 2007 5:45 AM
>  To: php-general
>  Subject: [PHP] excluding parenthesis, space and dashes from
>  phone number
> 
>  hi,
>  I store phone number in mysql as integer, e.g. (123) 456-7890
>  is stored
>  as 1234567890.
>  though, in search form they usually type in a phone number with
>  parenthesis/space/dashes. I have to extract numbers before I search
>  through mysql.
> 
>  currently, I use eregi_replace() function, several times, to
>  do the job:
>  eregi_replace(' ', '', $phone);
>  eregi_replace('(', '', $phone);
>  eregi_replace(')', '', $phone);
>  eregi_replace('-', '', $phone);
>  and it works fine.
> 
>  but, is there any better way? more "fancy"? :)
> 
>  thanks for any help.
> 
>  -afan
> 
>  --
>  PHP General Mailing List (http://www.php.net/)
>  To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Calling a stored procedure

2007-11-30 Thread Dan Shirah
ALMOST have it!

I have changed the code to this:

if ($num_rows > 0 && $barcode_id == "") {
 echo "The query found ".$num_rows." row(s)";
 $procedure = "Execute Procedure informix.updt_brcd_id_req('$case',
'$event_date', '$event_sequence', '$event_code')";
print_r ($procedure);
 $run = ifx_query($procedure, $connect_id);
 }

When I submit the form it gives me this error: PHP Warning: ifx_query() [
function.ifx-query ]:
Execute immediate fails

BUT!!!   The stored procedure still runs and updates my data correctly.

Any ideas what might be throwing that error and how to get rid of it?

Thanks!
Dan


On 11/30/07, Andrés Robinet <[EMAIL PROTECTED]> wrote:
>
> > -Original Message-
> > From: Dan Shirah [mailto:[EMAIL PROTECTED]
> > Sent: Friday, November 30, 2007 4:00 PM
> > To: Daniel Brown
> > Cc: php-general
> > Subject: Re: [PHP] Calling a stored procedure
> >
> > I tried a different approach with the code below:
> >
> > if ($num_rows > 0 && $barcode_id == "") {
> >  echo "The query found ".$num_rows." row(s)";
> >  $call_procedure = "CALL informix.updt_brcd_id_req('$case',
> > '$event_date',
> > '$event_sequence', '$event_code')";
> >  $call_result = ifx_query($connect_id, $call_procedure);
> >  }
> >
> > And I get the error: PHP Warning: ifx_query(): supplied argument is not
> > a
> > valid Informix link resource
> >
> > I don't know if this is a step in the right direction or not.
> >
> >
> > On 11/30/07, Dan Shirah <[EMAIL PROTECTED]> wrote:
> > >
> > > I'm not sure if we're on the same page.
> > >
> > > I have a stored procedure on my Informix server. All I am trying to
> > do is
> > > create a simple form that when submitted will pass several parameters
> > to the
> > > stored procedure and execute it.
> > >
> > > I shouldn't have to pass the head/body/content to the Informix server
> > to
> > > execute the procedure, right?
> > >
> > >
> > >  On 11/30/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> > > >
> > > > On Nov 30, 2007 1:39 PM, Dan Shirah <[EMAIL PROTECTED]> wrote:
> > > > > Hello all,
> > > > >
> > > > > I am having soem difficulty when trying to call an INFORMIX
> > stored
> > > > procedure
> > > > > with PHP.
> > > > >
> > > > > I have verified that the if() condition is true and all of the
> > > > parameters I
> > > > > am passing are valid. However, when I run the following:
> > > > >
> > > > > if ($num_rows > 0 && $barcode_id == "") {
> > > > >  echo "The query found ".$num_rows." row(s)";
> > > > >  $call_procedure = "CALL informix.updt_brcd_id_req('$case',
> > > > '$event_date',
> > > > > '$event_sequence', '$event_code')";
> > > > >  $call_result = $connect_id->query($call_procedure);
> > > > >  }
> > > > >
> > > > > I get this error message: PHP Fatal error: Call to a member
> > function
> > > > query()
> > > > > on a non-object
> > > > >
> > > > > I have never tried to call a stored procedure in PHP before so
> > I'm not
> > > > even
> > > > > sure if I am on the right track.
> > > > >
> > > > > Any help is greatly appreciated.
> > > > >
> > > > > Dan
> > > > >
> > > >
> > > >You have to first instantiate the class.
> > > >
> > > >For example:
> > > >
> > > >  > > > include_once("classes/layout.class.php");
> > > > $H = new Head();
> > > > $B = new Body();
> > > > $P = new Page($H, $B);
> > > > $H->title("A Sample PHP Page");
> > > > $H->css("sample.css");
> > > > $B->content("This is where Dan Shirah's content would go.");
> > > > $P->render();
> > > > ?>
> > > >
> > > > --
> > > > Daniel P. Brown
> > > > [office] (570-) 587-7080 Ext. 272
> > > > [mobile] (570-) 766-8107
> > > >
> > > > If at first you don't succeed, stick to what you know best so that
> > you
> > > > can make enough money to pay someone else to do it for you.
> > > >
> > >
> > >
>
> The order of parameters is reverted. Try:
>
> $call_result = ifx_query($call_procedure, $connect_id);
>
> ... and RTFM http://php.net/manual/en/function.ifx-query.php
>
> Rob
>
> Andrés Robinet | Lead Developer | BESTPLACE CORPORATION
> 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL
> 33308
> | TEL 954-607-4207 | FAX 954-337-2695
> Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE:
> bestplace |  Web: http://www.bestplace.biz | Web: http://www.seo-diy.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] including parenthesis, space and dashes in a phone number

2007-11-30 Thread Jochem Maas
Warren Vail wrote:
> Not to mention that syntax works in the US, but not large portions of the
> rest of the world.  (even with the 1 country code in front).

can't remember when that ever stopped an american.

e.g. Windows print subsystem that shoves 'Letter' format down
your throat as the default even though the OS knows damn well I'm
using a european locale.

> 
> Warren vail
> 
>> -Original Message-
>> From: afan pasalic [mailto:[EMAIL PROTECTED]
>> Sent: Friday, November 30, 2007 12:03 PM
>> To: Daevid Vincent
>> Cc: 'php-general'
>> Subject: Re: [PHP] including parenthesis, space and dashes in a phone
>> number
>>
>> It's ok to store it this way, but it could be a little PITA when search.
>> E.g., you store (123) 456-7890 and somebody search for 123-456-7890?
>> Right?
>>
>> -afan
>>
>>
>>
>> Daevid Vincent wrote:
>>> The kind of opposite of this, is what I use, in that it ADDs the () and
>> -
>>> if ((strlen($phone)) <= 14) $phone =
>>> preg_replace("/[^0-9]*([0-9]{3})[^0-9]*([0-9]{3})[^0-9]*([0-9]{4}).*/",
>>>   "(\\1) \\2-\\3", $phone);
>>>
 -Original Message-
 From: afan pasalic [mailto:[EMAIL PROTECTED]
 Sent: Friday, November 30, 2007 5:45 AM
 To: php-general
 Subject: [PHP] excluding parenthesis, space and dashes from
 phone number

 hi,
 I store phone number in mysql as integer, e.g. (123) 456-7890
 is stored
 as 1234567890.
 though, in search form they usually type in a phone number with
 parenthesis/space/dashes. I have to extract numbers before I search
 through mysql.

 currently, I use eregi_replace() function, several times, to
 do the job:
 eregi_replace(' ', '', $phone);
 eregi_replace('(', '', $phone);
 eregi_replace(')', '', $phone);
 eregi_replace('-', '', $phone);
 and it works fine.

 but, is there any better way? more "fancy"? :)

 thanks for any help.

 -afan

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] including parenthesis, space and dashes in a phone number

2007-11-30 Thread Warren Vail
Not to mention that syntax works in the US, but not large portions of the
rest of the world.  (even with the 1 country code in front).

Warren vail

> -Original Message-
> From: afan pasalic [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 30, 2007 12:03 PM
> To: Daevid Vincent
> Cc: 'php-general'
> Subject: Re: [PHP] including parenthesis, space and dashes in a phone
> number
> 
> It's ok to store it this way, but it could be a little PITA when search.
> E.g., you store (123) 456-7890 and somebody search for 123-456-7890?
> Right?
> 
> -afan
> 
> 
> 
> Daevid Vincent wrote:
> > The kind of opposite of this, is what I use, in that it ADDs the () and
> -
> >
> > if ((strlen($phone)) <= 14) $phone =
> > preg_replace("/[^0-9]*([0-9]{3})[^0-9]*([0-9]{3})[^0-9]*([0-9]{4}).*/",
> >   "(\\1) \\2-\\3", $phone);
> >
> >> -Original Message-
> >> From: afan pasalic [mailto:[EMAIL PROTECTED]
> >> Sent: Friday, November 30, 2007 5:45 AM
> >> To: php-general
> >> Subject: [PHP] excluding parenthesis, space and dashes from
> >> phone number
> >>
> >> hi,
> >> I store phone number in mysql as integer, e.g. (123) 456-7890
> >> is stored
> >> as 1234567890.
> >> though, in search form they usually type in a phone number with
> >> parenthesis/space/dashes. I have to extract numbers before I search
> >> through mysql.
> >>
> >> currently, I use eregi_replace() function, several times, to
> >> do the job:
> >> eregi_replace(' ', '', $phone);
> >> eregi_replace('(', '', $phone);
> >> eregi_replace(')', '', $phone);
> >> eregi_replace('-', '', $phone);
> >> and it works fine.
> >>
> >> but, is there any better way? more "fancy"? :)
> >>
> >> thanks for any help.
> >>
> >> -afan
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] including parenthesis, space and dashes in a phone number

2007-11-30 Thread afan pasalic
It's ok to store it this way, but it could be a little PITA when search.
E.g., you store (123) 456-7890 and somebody search for 123-456-7890? Right?

-afan



Daevid Vincent wrote:
> The kind of opposite of this, is what I use, in that it ADDs the () and -
> 
> if ((strlen($phone)) <= 14) $phone = 
> preg_replace("/[^0-9]*([0-9]{3})[^0-9]*([0-9]{3})[^0-9]*([0-9]{4}).*/",
> "(\\1) \\2-\\3", $phone); 
> 
>> -Original Message-
>> From: afan pasalic [mailto:[EMAIL PROTECTED] 
>> Sent: Friday, November 30, 2007 5:45 AM
>> To: php-general
>> Subject: [PHP] excluding parenthesis, space and dashes from 
>> phone number
>>
>> hi,
>> I store phone number in mysql as integer, e.g. (123) 456-7890 
>> is stored
>> as 1234567890.
>> though, in search form they usually type in a phone number with
>> parenthesis/space/dashes. I have to extract numbers before I search
>> through mysql.
>>
>> currently, I use eregi_replace() function, several times, to 
>> do the job:
>> eregi_replace(' ', '', $phone);
>> eregi_replace('(', '', $phone);
>> eregi_replace(')', '', $phone);
>> eregi_replace('-', '', $phone);
>> and it works fine.
>>
>> but, is there any better way? more "fancy"? :)
>>
>> thanks for any help.
>>
>> -afan
>>
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] including parenthesis, space and dashes in a phone number

2007-11-30 Thread Daevid Vincent
The kind of opposite of this, is what I use, in that it ADDs the () and -

if ((strlen($phone)) <= 14) $phone = 
preg_replace("/[^0-9]*([0-9]{3})[^0-9]*([0-9]{3})[^0-9]*([0-9]{4}).*/",
  "(\\1) \\2-\\3", $phone); 

> -Original Message-
> From: afan pasalic [mailto:[EMAIL PROTECTED] 
> Sent: Friday, November 30, 2007 5:45 AM
> To: php-general
> Subject: [PHP] excluding parenthesis, space and dashes from 
> phone number
> 
> hi,
> I store phone number in mysql as integer, e.g. (123) 456-7890 
> is stored
> as 1234567890.
> though, in search form they usually type in a phone number with
> parenthesis/space/dashes. I have to extract numbers before I search
> through mysql.
> 
> currently, I use eregi_replace() function, several times, to 
> do the job:
> eregi_replace(' ', '', $phone);
> eregi_replace('(', '', $phone);
> eregi_replace(')', '', $phone);
> eregi_replace('-', '', $phone);
> and it works fine.
> 
> but, is there any better way? more "fancy"? :)
> 
> thanks for any help.
> 
> -afan
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Calling a stored procedure

2007-11-30 Thread Andrés Robinet
> -Original Message-
> From: Dan Shirah [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 30, 2007 4:00 PM
> To: Daniel Brown
> Cc: php-general
> Subject: Re: [PHP] Calling a stored procedure
> 
> I tried a different approach with the code below:
> 
> if ($num_rows > 0 && $barcode_id == "") {
>  echo "The query found ".$num_rows." row(s)";
>  $call_procedure = "CALL informix.updt_brcd_id_req('$case',
> '$event_date',
> '$event_sequence', '$event_code')";
>  $call_result = ifx_query($connect_id, $call_procedure);
>  }
> 
> And I get the error: PHP Warning: ifx_query(): supplied argument is not
> a
> valid Informix link resource
> 
> I don't know if this is a step in the right direction or not.
> 
> 
> On 11/30/07, Dan Shirah <[EMAIL PROTECTED]> wrote:
> >
> > I'm not sure if we're on the same page.
> >
> > I have a stored procedure on my Informix server. All I am trying to
> do is
> > create a simple form that when submitted will pass several parameters
> to the
> > stored procedure and execute it.
> >
> > I shouldn't have to pass the head/body/content to the Informix server
> to
> > execute the procedure, right?
> >
> >
> >  On 11/30/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> > >
> > > On Nov 30, 2007 1:39 PM, Dan Shirah <[EMAIL PROTECTED]> wrote:
> > > > Hello all,
> > > >
> > > > I am having soem difficulty when trying to call an INFORMIX
> stored
> > > procedure
> > > > with PHP.
> > > >
> > > > I have verified that the if() condition is true and all of the
> > > parameters I
> > > > am passing are valid. However, when I run the following:
> > > >
> > > > if ($num_rows > 0 && $barcode_id == "") {
> > > >  echo "The query found ".$num_rows." row(s)";
> > > >  $call_procedure = "CALL informix.updt_brcd_id_req('$case',
> > > '$event_date',
> > > > '$event_sequence', '$event_code')";
> > > >  $call_result = $connect_id->query($call_procedure);
> > > >  }
> > > >
> > > > I get this error message: PHP Fatal error: Call to a member
> function
> > > query()
> > > > on a non-object
> > > >
> > > > I have never tried to call a stored procedure in PHP before so
> I'm not
> > > even
> > > > sure if I am on the right track.
> > > >
> > > > Any help is greatly appreciated.
> > > >
> > > > Dan
> > > >
> > >
> > >You have to first instantiate the class.
> > >
> > >For example:
> > >
> > >  > > include_once("classes/layout.class.php");
> > > $H = new Head();
> > > $B = new Body();
> > > $P = new Page($H, $B);
> > > $H->title("A Sample PHP Page");
> > > $H->css("sample.css");
> > > $B->content("This is where Dan Shirah's content would go.");
> > > $P->render();
> > > ?>
> > >
> > > --
> > > Daniel P. Brown
> > > [office] (570-) 587-7080 Ext. 272
> > > [mobile] (570-) 766-8107
> > >
> > > If at first you don't succeed, stick to what you know best so that
> you
> > > can make enough money to pay someone else to do it for you.
> > >
> >
> >

The order of parameters is reverted. Try:

$call_result = ifx_query($call_procedure, $connect_id);

... and RTFM http://php.net/manual/en/function.ifx-query.php

Rob

Andrés Robinet | Lead Developer | BESTPLACE CORPORATION
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308
| TEL 954-607-4207 | FAX 954-337-2695
Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE:
bestplace |  Web: http://www.bestplace.biz | Web: http://www.seo-diy.com



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Rewind foreach loop

2007-11-30 Thread Robert Cummings
On Fri, 2007-11-30 at 14:46 -0500, Robert Cummings wrote:
>
> This is dangerous use of the array functions. A problem occurs when you
> have a value that evaluates to false (such as the first entry in the
> example array :). In fact the only way to ensure you traverse the array
> properly is to use each() since it returns an array except when no more
> entries exist. Also you want to reset() the array before looping
> (normally anyways).
> 
>  
> reset( $data );
> while( ($entry = each( $data )) )
> {
> // ...
> 
> if( $errorCondition )
> {
> prev( $data );
> continue;
> }
> 
> next( $data );

Newbie bug!! Newbie bug!! each() advances the array pointer so don't do
a next() call :)

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Rewind foreach loop

2007-11-30 Thread Robert Cummings
On Fri, 2007-11-30 at 09:51 -0800, Jim Lucas wrote:
> Jeffery Fernandez wrote:
> > Hi all,
> > 
> > Is it possible to rewind a foreach loop? eg:
> > 
> > 
> > $numbers = array(0,1,2,3,4,5,6,7,8,9,10);
> > 
> > foreach ($numbers as $index => $value)
> > {
> > if ($value == 5)
> > {
> > prev($numbers);
> > }
> > echo "Value: $value" . PHP_EOL;
> > }
> > 
> > The above doesn't seem to work. In one of my scenarios, when I encounter 
> > and 
> > error in a foreach loop, I need the ability to rewind the array pointer by 
> > one. How can I achieve this?
> > 
> > regards,
> > Jeffery
> 
> No, you can't rewind the array.  Foreach makes a copy of the array, and works 
> off that copy.
> 
> You might need to look into using do...while() instead
> 
> Something thing like this should work.
> 
> 
>  
> $row = current($your_array);  Gives you the first element in $your_array
> 
> do {
> 
> ...
> work with your $row...
> determine if their is an error
> ...
> 
>   if ( $error ) {
>   # Watch out for infinite loop
>   # maybe have a counter that increments each time it rewinds 
> $your_array
>   #and have it stop at 10 loops or something.
>   prev($your_array);
>   }
> } while( $row = next($your_array) );
> 
> ?>

This is dangerous use of the array functions. A problem occurs when you
have a value that evaluates to false (such as the first entry in the
example array :). In fact the only way to ensure you traverse the array
properly is to use each() since it returns an array except when no more
entries exist. Also you want to reset() the array before looping
(normally anyways).



Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Calling a stored procedure

2007-11-30 Thread Warren Vail
I believe you need to send the call to the stored procedure to the database
as if it were a query, instead of asking PHP to execute it.

HTH,

Warren Vail

> -Original Message-
> From: Dan Shirah [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 30, 2007 10:57 AM
> To: Daniel Brown
> Cc: php-general
> Subject: Re: [PHP] Calling a stored procedure
> 
> I'm not sure if we're on the same page.
> 
> I have a stored procedure on my Informix server. All I am trying to do is
> create a simple form that when submitted will pass several parameters to
> the
> stored procedure and execute it.
> 
> I shouldn't have to pass the head/body/content to the Informix server to
> execute the procedure, right?
> 
> 
> On 11/30/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> >
> > On Nov 30, 2007 1:39 PM, Dan Shirah <[EMAIL PROTECTED]> wrote:
> > > Hello all,
> > >
> > > I am having soem difficulty when trying to call an INFORMIX stored
> > procedure
> > > with PHP.
> > >
> > > I have verified that the if() condition is true and all of the
> > parameters I
> > > am passing are valid. However, when I run the following:
> > >
> > > if ($num_rows > 0 && $barcode_id == "") {
> > >  echo "The query found ".$num_rows." row(s)";
> > >  $call_procedure = "CALL informix.updt_brcd_id_req('$case',
> > '$event_date',
> > > '$event_sequence', '$event_code')";
> > >  $call_result = $connect_id->query($call_procedure);
> > >  }
> > >
> > > I get this error message: PHP Fatal error: Call to a member function
> > query()
> > > on a non-object
> > >
> > > I have never tried to call a stored procedure in PHP before so I'm not
> > even
> > > sure if I am on the right track.
> > >
> > > Any help is greatly appreciated.
> > >
> > > Dan
> > >
> >
> >You have to first instantiate the class.
> >
> >For example:
> >
> >  > include_once("classes/layout.class.php");
> > $H = new Head();
> > $B = new Body();
> > $P = new Page($H, $B);
> > $H->title("A Sample PHP Page");
> > $H->css("sample.css");
> > $B->content("This is where Dan Shirah's content would go.");
> > $P->render();
> > ?>
> >
> > --
> > Daniel P. Brown
> > [office] (570-) 587-7080 Ext. 272
> > [mobile] (570-) 766-8107
> >
> > If at first you don't succeed, stick to what you know best so that you
> > can make enough money to pay someone else to do it for you.
> >

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Calling a stored procedure

2007-11-30 Thread Daniel Brown
On Nov 30, 2007 1:56 PM, Dan Shirah <[EMAIL PROTECTED]> wrote:
> I'm not sure if we're on the same page.
>
> I have a stored procedure on my Informix server. All I am trying to do is
> create a simple form that when submitted will pass several parameters to the
> stored procedure and execute it.
>
> I shouldn't have to pass the head/body/content to the Informix server to
> execute the procedure, right?
>
>
>
>
> On 11/30/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> > On Nov 30, 2007 1:39 PM, Dan Shirah <[EMAIL PROTECTED]> wrote:
> > > Hello all,
> > >
> > > I am having soem difficulty when trying to call an INFORMIX stored
> procedure
> > > with PHP.
> > >
> > > I have verified that the if() condition is true and all of the
> parameters I
> > > am passing are valid. However, when I run the following:
> > >
> > > if ($num_rows > 0 && $barcode_id == "") {
> > >  echo "The query found ".$num_rows." row(s)";
> > >  $call_procedure = "CALL informix.updt_brcd_id_req('$case',
> '$event_date',
> > > '$event_sequence', '$event_code')";
> > >  $call_result = $connect_id->query($call_procedure);
> > >  }
> > >
> > > I get this error message: PHP Fatal error: Call to a member function
> query()
> > > on a non-object
> > >
> > > I have never tried to call a stored procedure in PHP before so I'm not
> even
> > > sure if I am on the right track.
> > >
> > > Any help is greatly appreciated.
> > >
> > > Dan
> > >
> >
> >You have to first instantiate the class.
> >
> >For example:
> >
> >  > include_once("classes/layout.class.php");
> > $H = new Head();
> > $B = new Body();
> > $P = new Page($H, $B);
> > $H->title("A Sample PHP Page");
> > $H->css("sample.css");
> > $B->content("This is where Dan Shirah's content would go.");
> > $P->render();
> > ?>
> >
> > --
> > Daniel P. Brown
> > [office] (570-) 587-7080 Ext. 272
> > [mobile] (570-) 766-8107
> >
> > If at first you don't succeed, stick to what you know best so that you
> > can make enough money to pay someone else to do it for you.
> >
>
>

No, not at all.  I just included that as dummy data to illustrate
the point.  The thing to pay attention to is the instantiation.  For
your case, it should probably look something like this:



Well, something of the like, anyway.

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Calling a stored procedure

2007-11-30 Thread Dan Shirah
I tried a different approach with the code below:

if ($num_rows > 0 && $barcode_id == "") {
 echo "The query found ".$num_rows." row(s)";
 $call_procedure = "CALL informix.updt_brcd_id_req('$case', '$event_date',
'$event_sequence', '$event_code')";
 $call_result = ifx_query($connect_id, $call_procedure);
 }

And I get the error: PHP Warning: ifx_query(): supplied argument is not a
valid Informix link resource

I don't know if this is a step in the right direction or not.


On 11/30/07, Dan Shirah <[EMAIL PROTECTED]> wrote:
>
> I'm not sure if we're on the same page.
>
> I have a stored procedure on my Informix server. All I am trying to do is
> create a simple form that when submitted will pass several parameters to the
> stored procedure and execute it.
>
> I shouldn't have to pass the head/body/content to the Informix server to
> execute the procedure, right?
>
>
>  On 11/30/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> >
> > On Nov 30, 2007 1:39 PM, Dan Shirah <[EMAIL PROTECTED]> wrote:
> > > Hello all,
> > >
> > > I am having soem difficulty when trying to call an INFORMIX stored
> > procedure
> > > with PHP.
> > >
> > > I have verified that the if() condition is true and all of the
> > parameters I
> > > am passing are valid. However, when I run the following:
> > >
> > > if ($num_rows > 0 && $barcode_id == "") {
> > >  echo "The query found ".$num_rows." row(s)";
> > >  $call_procedure = "CALL informix.updt_brcd_id_req('$case',
> > '$event_date',
> > > '$event_sequence', '$event_code')";
> > >  $call_result = $connect_id->query($call_procedure);
> > >  }
> > >
> > > I get this error message: PHP Fatal error: Call to a member function
> > query()
> > > on a non-object
> > >
> > > I have never tried to call a stored procedure in PHP before so I'm not
> > even
> > > sure if I am on the right track.
> > >
> > > Any help is greatly appreciated.
> > >
> > > Dan
> > >
> >
> >You have to first instantiate the class.
> >
> >For example:
> >
> >  > include_once("classes/layout.class.php");
> > $H = new Head();
> > $B = new Body();
> > $P = new Page($H, $B);
> > $H->title("A Sample PHP Page");
> > $H->css("sample.css");
> > $B->content("This is where Dan Shirah's content would go.");
> > $P->render();
> > ?>
> >
> > --
> > Daniel P. Brown
> > [office] (570-) 587-7080 Ext. 272
> > [mobile] (570-) 766-8107
> >
> > If at first you don't succeed, stick to what you know best so that you
> > can make enough money to pay someone else to do it for you.
> >
>
>


Re: [PHP] Calling a stored procedure

2007-11-30 Thread Dan Shirah
I'm not sure if we're on the same page.

I have a stored procedure on my Informix server. All I am trying to do is
create a simple form that when submitted will pass several parameters to the
stored procedure and execute it.

I shouldn't have to pass the head/body/content to the Informix server to
execute the procedure, right?


On 11/30/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
>
> On Nov 30, 2007 1:39 PM, Dan Shirah <[EMAIL PROTECTED]> wrote:
> > Hello all,
> >
> > I am having soem difficulty when trying to call an INFORMIX stored
> procedure
> > with PHP.
> >
> > I have verified that the if() condition is true and all of the
> parameters I
> > am passing are valid. However, when I run the following:
> >
> > if ($num_rows > 0 && $barcode_id == "") {
> >  echo "The query found ".$num_rows." row(s)";
> >  $call_procedure = "CALL informix.updt_brcd_id_req('$case',
> '$event_date',
> > '$event_sequence', '$event_code')";
> >  $call_result = $connect_id->query($call_procedure);
> >  }
> >
> > I get this error message: PHP Fatal error: Call to a member function
> query()
> > on a non-object
> >
> > I have never tried to call a stored procedure in PHP before so I'm not
> even
> > sure if I am on the right track.
> >
> > Any help is greatly appreciated.
> >
> > Dan
> >
>
>You have to first instantiate the class.
>
>For example:
>
>  include_once("classes/layout.class.php");
> $H = new Head();
> $B = new Body();
> $P = new Page($H, $B);
> $H->title("A Sample PHP Page");
> $H->css("sample.css");
> $B->content("This is where Dan Shirah's content would go.");
> $P->render();
> ?>
>
> --
> Daniel P. Brown
> [office] (570-) 587-7080 Ext. 272
> [mobile] (570-) 766-8107
>
> If at first you don't succeed, stick to what you know best so that you
> can make enough money to pay someone else to do it for you.
>


Re: [PHP] Calling a stored procedure

2007-11-30 Thread Daniel Brown
On Nov 30, 2007 1:39 PM, Dan Shirah <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I am having soem difficulty when trying to call an INFORMIX stored procedure
> with PHP.
>
> I have verified that the if() condition is true and all of the parameters I
> am passing are valid. However, when I run the following:
>
> if ($num_rows > 0 && $barcode_id == "") {
>  echo "The query found ".$num_rows." row(s)";
>  $call_procedure = "CALL informix.updt_brcd_id_req('$case', '$event_date',
> '$event_sequence', '$event_code')";
>  $call_result = $connect_id->query($call_procedure);
>  }
>
> I get this error message: PHP Fatal error: Call to a member function query()
> on a non-object
>
> I have never tried to call a stored procedure in PHP before so I'm not even
> sure if I am on the right track.
>
> Any help is greatly appreciated.
>
> Dan
>

You have to first instantiate the class.

For example:

title("A Sample PHP Page");
$H->css("sample.css");
$B->content("This is where Dan Shirah's content would go.");
$P->render();
?>

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Calling a stored procedure

2007-11-30 Thread Dan Shirah
Hello all,

I am having soem difficulty when trying to call an INFORMIX stored procedure
with PHP.

I have verified that the if() condition is true and all of the parameters I
am passing are valid. However, when I run the following:

if ($num_rows > 0 && $barcode_id == "") {
 echo "The query found ".$num_rows." row(s)";
 $call_procedure = "CALL informix.updt_brcd_id_req('$case', '$event_date',
'$event_sequence', '$event_code')";
 $call_result = $connect_id->query($call_procedure);
 }

I get this error message: PHP Fatal error: Call to a member function query()
on a non-object

I have never tried to call a stored procedure in PHP before so I'm not even
sure if I am on the right track.

Any help is greatly appreciated.

Dan


Re: [PHP] Join question

2007-11-30 Thread Daniel Brown
That it is, Steve.  That it is.

And because of the occasion, I feel justified in celebrating by top-posting.

TFGIF!

On Nov 30, 2007 12:58 PM, Steve Edberg <[EMAIL PROTECTED]> wrote:
> At 10:30 AM -0500 11/30/07, Daniel Brown wrote:
> >On Nov 30, 2007 10:22 AM, Jochem Maas <[EMAIL PROTECTED]> wrote:
> >>  Daniel Brown wrote:
> >>  > I was tempted to flame Tedd just because he's Tedd.  ;-P
> >>
> >>  lol. but then the guy was programming Rocks(tm) way before I was
> >>  born, that has to count for something :-)
> >
> >
> > Please keep all replies on the list, Jochem.  ;-P
> >
> > HA!  It was too good not to share.
>
>
> Programming Rocks you say? It's not that old...
>
> http://www.rocksclusters.org/wordpress/
>
> :)
>
> It appears to be a Friday...
>
> - steve
>
> --
> +--- my people are the people of the dessert, ---+
> | Steve Edberghttp://pgfsun.ucdavis.edu/ |
> | UC Davis Genome Center[EMAIL PROTECTED] |
> | Bioinformatics programming/database/sysadmin (530)754-9127 |
> + said t e lawrence, picking up his fork +
>



-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Join question

2007-11-30 Thread Steve Edberg

At 10:30 AM -0500 11/30/07, Daniel Brown wrote:

On Nov 30, 2007 10:22 AM, Jochem Maas <[EMAIL PROTECTED]> wrote:

 Daniel Brown wrote:
 > I was tempted to flame Tedd just because he's Tedd.  ;-P

 lol. but then the guy was programming Rocks(tm) way before I was
 born, that has to count for something :-)



Please keep all replies on the list, Jochem.  ;-P

HA!  It was too good not to share.



Programming Rocks you say? It's not that old...

http://www.rocksclusters.org/wordpress/

:)

It appears to be a Friday...

- steve

--
+--- my people are the people of the dessert, ---+
| Steve Edberghttp://pgfsun.ucdavis.edu/ |
| UC Davis Genome Center[EMAIL PROTECTED] |
| Bioinformatics programming/database/sysadmin (530)754-9127 |
+ said t e lawrence, picking up his fork +

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Rewind foreach loop

2007-11-30 Thread Jim Lucas

Jeffery Fernandez wrote:

Hi all,

Is it possible to rewind a foreach loop? eg:


$numbers = array(0,1,2,3,4,5,6,7,8,9,10);

foreach ($numbers as $index => $value)
{
if ($value == 5)
{
prev($numbers);
}
echo "Value: $value" . PHP_EOL;
}

The above doesn't seem to work. In one of my scenarios, when I encounter and 
error in a foreach loop, I need the ability to rewind the array pointer by 
one. How can I achieve this?


regards,
Jeffery


No, you can't rewind the array.  Foreach makes a copy of the array, and works 
off that copy.

You might need to look into using do...while() instead

Something thing like this should work.





This way, you are working on the only copy of $your_array

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Join question

2007-11-30 Thread Jochem Maas
Daniel Brown wrote:
> On Nov 30, 2007 10:22 AM, Jochem Maas <[EMAIL PROTECTED]> wrote:
>> Daniel Brown wrote:
>>> I was tempted to flame Tedd just because he's Tedd.  ;-P
>> lol. but then the guy was programming Rocks(tm) way before I was
>> born, that has to count for something :-)
> 
> 
> Please keep all replies on the list, Jochem.  ;-P

crap - guess I hit reply instead of 'reply all' by mistake.

> 
> HA!  It was too good not to share.
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Join question

2007-11-30 Thread Daniel Brown
On Nov 30, 2007 10:22 AM, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Daniel Brown wrote:
> > I was tempted to flame Tedd just because he's Tedd.  ;-P
>
> lol. but then the guy was programming Rocks(tm) way before I was
> born, that has to count for something :-)


Please keep all replies on the list, Jochem.  ;-P

HA!  It was too good not to share.

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Join question [solved]

2007-11-30 Thread Wolf
 tedd <[EMAIL PROTECTED]> wrote: 
> Hi gang:
> 
> I found why the JOIN didn't work for me in this instance, which was I 
> needed to create a third table and JOIN what I needed in that table 
> from the other two.
> 
> My problem was that I was trying to alter one of the tables in the 
> JOIN. While that might be possible it didn't appear so in my current 
> problem.
> 
> Thanks for letting me bounce ideas off you peoples.
> 
> Cheers,
> 
> tedd

Glad you found an answer tedd, I was going to start digging through my old 
MySQL stuff and see what I could dig up, it's been a couple of years since 
doing any DB work that needed any of that.   Looks like the language and fun 
have changed since then!

Gotta love improvements.

Wolf

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] excluding parenthesis, space and dashes from phone number

2007-11-30 Thread afan pasalic


Jochem Maas wrote:
> afan pasalic wrote:
>> hi,
>> I store phone number in mysql as integer, e.g. (123) 456-7890 is stored
>> as 1234567890.
>> though, in search form they usually type in a phone number with
>> parenthesis/space/dashes. I have to extract numbers before I search
>> through mysql.
>>
>> currently, I use eregi_replace() function, several times, to do the job:
>> eregi_replace(' ', '', $phone);
>> eregi_replace('(', '', $phone);
>> eregi_replace(')', '', $phone);
>> eregi_replace('-', '', $phone);
> 
> side note: if you are doing simple string relacement (as in the code above)
> don't use regular expression functionality to do it, it a waste.
> 
> the above code will work the same if you replace 'eregi_replace' with 
> 'str_replace'
> 
>> and it works fine.
>>
>> but, is there any better way? more "fancy"? :)
> 
> see TGs example. I recommend doing some study on regexps - knowing abit about
> them and how to write a basic regexp is an invaluable tool.

Got it!
Thanks guys for your help.

-afan


> 
>> thanks for any help.
>>
>> -afan
>>
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP RFC # 0001 --- List Etiquette

2007-11-30 Thread Daniel Brown
On Nov 30, 2007 10:41 AM, Philip Thompson <[EMAIL PROTECTED]> wrote:
>
> On Nov 28, 2007 9:48 AM, Daniel Brown <[EMAIL PROTECTED]> wrote:
>
> >Good morning (/afternoon/evening) all;
> >
> >This is more or less an RFC-type email, hence the subject line.  I
> > would like to see your comments on this case, and maybe we can forge
> > some sort of agreement or unofficial treaty or something.
> >
> >Oftentimes we see a user post a question to the list, with ongoing
> > discussion back-and-forth on a troublesome issue, and when a solution
> > is found, the subject line has an added [SOLVED] tag on it.  While
> > this makes sense in a forum style arena, where posts are binded
> > statically in the same group, it defeats the purpose of mailing list
> > archives such as Nabble and GMANE.  A recent email from this morning
> > illustrates the problem, as displayed presently at this page:
> >http://www.nabble.com/PHP---General-f140.html
> >
> >The email  with the subject "The PHP License" received commentary
> > from both Jochem Maas and myself, and the OP (AmirBehzad Eslami)
> > replied to the message, appending the [SOLVED] tag to the subject.
> > This is not a serious issue in this particular matter, as it was a
> > simple thank-you message out of politeness (which is greatly
> > appreciated, Amir!).  However, using just a single example should help
> > to emphasize my point exponentially when you consider the frequency of
> > occurrences we see following the [SOLVED]-appended route.
> >
> >On 12 September, 2007, Zbigniew Szalbot posted a message to the
> > list about a segmentation fault in PHP 5.2.3.  Over the next 24
> > hours-plus, exactly sixty comments passed back-and-forth on the
> > thread.  When a solution was found, it was posted in a separate email
> > with the [SOLVED] tag added to the subject line, and two additional
> > comments added to that (entirely new) thread.
> >
> >Why is this such a critical issue?  Because if we hope not to have
> > to answer the same questions over and over again, instructing people
> > to properly STFW, then we should at least be contributing to proper
> > archival and documentation of problems we've successfully solved.
> > Using the aforementioned example, we check Google for the same
> > problem:
> >
> >
> > http://www.google.com/search?q=php+5.2.3+segmentation+fault+core+dumped
> >
> >Hooray!  Someone else has had the exact same list of problems, and
> > now I can simply go through all of the responses and it should
> > (fingers crossed!) correct my issues as well.
> >
> >Message 58 59 getting close! sixty-one WHAT?!?  No
> > solution?  Back to Google only to find that each result is exactly
> > the same discussion, never including the final three emails.
> >
> >So the summary of my proposal is as follows:
> >
> >1.) An issue has been identified with the list whereby
> > improper archival will likely lead to repeat questions and unnecessary
> > traffic to the list.
> >2.) I propose that we discontinue the act of subject
> > modification to indicate a change in status of the issue (SOLVED,
> > ALSO, ANOTHER PROBLEM, etc.) unless a completely different problem is
> > reached or question is asked.  This will allow a step-by-step document
> > (of sorts) to be created and made "searchable" on the web.
> >
> >
> >
> >Comments welcomed!
> >
> > --
> > Daniel P. Brown
> > [office] (570-) 587-7080 Ext. 272
> > [mobile] (570-) 766-8107
>
>
>
> I haven't checked this mail in several days. So... sorry if this thread is
> "defunct". =D
>
> As others have mentioned, the problem is hitting "New" email. Many (Dare I
> say "all"? No, no. No I won't.) email clients are smart enough to thread
> emails even if the subject has changed (and I know we have discussed that
> issue as well). So, hitting "reply" and adding on [SOLVED] *shouldn't* do
> anything... theoretically to break the thread and start a new one.
>
> Here's the real kicker... how do we enforce your proposed suggestion(s)? As
> active as this list is with new people coming regularly, the newer people
> won't know these *rules*. Throwing it on the welcome message, IMO, would
> only hit the people who read it which is probably about 5%. Oh, I have
> an idea... let's have a test! just to get on the list! You have to pass
> the test to send/receive messages!
>
> Ok, since it's taken me 30 minutes to write this email (I keep getting
> distracted), I'm quitting... Any thoughts?
>
> ~Philip
>

My thoughts were for us, the actual contributing community, to
take the few seconds to do this ourselves.  If someone pops in, asks a
question, and gets a response that solves it, then starts a new thread
with [SOLVED] in there, perhaps we could ask them to reply back to the
original thread, or even copy and paste it into the original thread
ourselves.  I know it will take one of us a few seconds, which can
mean the difference between life and de

Re: [PHP] PHP RFC # 0001 --- List Etiquette

2007-11-30 Thread Philip Thompson
On Nov 28, 2007 9:48 AM, Daniel Brown <[EMAIL PROTECTED]> wrote:

>Good morning (/afternoon/evening) all;
>
>This is more or less an RFC-type email, hence the subject line.  I
> would like to see your comments on this case, and maybe we can forge
> some sort of agreement or unofficial treaty or something.
>
>Oftentimes we see a user post a question to the list, with ongoing
> discussion back-and-forth on a troublesome issue, and when a solution
> is found, the subject line has an added [SOLVED] tag on it.  While
> this makes sense in a forum style arena, where posts are binded
> statically in the same group, it defeats the purpose of mailing list
> archives such as Nabble and GMANE.  A recent email from this morning
> illustrates the problem, as displayed presently at this page:
>http://www.nabble.com/PHP---General-f140.html
>
>The email  with the subject "The PHP License" received commentary
> from both Jochem Maas and myself, and the OP (AmirBehzad Eslami)
> replied to the message, appending the [SOLVED] tag to the subject.
> This is not a serious issue in this particular matter, as it was a
> simple thank-you message out of politeness (which is greatly
> appreciated, Amir!).  However, using just a single example should help
> to emphasize my point exponentially when you consider the frequency of
> occurrences we see following the [SOLVED]-appended route.
>
>On 12 September, 2007, Zbigniew Szalbot posted a message to the
> list about a segmentation fault in PHP 5.2.3.  Over the next 24
> hours-plus, exactly sixty comments passed back-and-forth on the
> thread.  When a solution was found, it was posted in a separate email
> with the [SOLVED] tag added to the subject line, and two additional
> comments added to that (entirely new) thread.
>
>Why is this such a critical issue?  Because if we hope not to have
> to answer the same questions over and over again, instructing people
> to properly STFW, then we should at least be contributing to proper
> archival and documentation of problems we've successfully solved.
> Using the aforementioned example, we check Google for the same
> problem:
>
>
> http://www.google.com/search?q=php+5.2.3+segmentation+fault+core+dumped
>
>Hooray!  Someone else has had the exact same list of problems, and
> now I can simply go through all of the responses and it should
> (fingers crossed!) correct my issues as well.
>
>Message 58 59 getting close! sixty-one WHAT?!?  No
> solution?  Back to Google only to find that each result is exactly
> the same discussion, never including the final three emails.
>
>So the summary of my proposal is as follows:
>
>1.) An issue has been identified with the list whereby
> improper archival will likely lead to repeat questions and unnecessary
> traffic to the list.
>2.) I propose that we discontinue the act of subject
> modification to indicate a change in status of the issue (SOLVED,
> ALSO, ANOTHER PROBLEM, etc.) unless a completely different problem is
> reached or question is asked.  This will allow a step-by-step document
> (of sorts) to be created and made "searchable" on the web.
>
>
>
>Comments welcomed!
>
> --
> Daniel P. Brown
> [office] (570-) 587-7080 Ext. 272
> [mobile] (570-) 766-8107



I haven't checked this mail in several days. So... sorry if this thread is
"defunct". =D

As others have mentioned, the problem is hitting "New" email. Many (Dare I
say "all"? No, no. No I won't.) email clients are smart enough to thread
emails even if the subject has changed (and I know we have discussed that
issue as well). So, hitting "reply" and adding on [SOLVED] *shouldn't* do
anything... theoretically to break the thread and start a new one.

Here's the real kicker... how do we enforce your proposed suggestion(s)? As
active as this list is with new people coming regularly, the newer people
won't know these *rules*. Throwing it on the welcome message, IMO, would
only hit the people who read it which is probably about 5%. Oh, I have
an idea... let's have a test! just to get on the list! You have to pass
the test to send/receive messages!

Ok, since it's taken me 30 minutes to write this email (I keep getting
distracted), I'm quitting... Any thoughts?

~Philip


Re: [PHP] excluding parenthesis, space and dashes from phone number

2007-11-30 Thread Zoltán Németh
2007. 11. 30, péntek keltezéssel 08.44-kor afan pasalic ezt írta:
> hi,
> I store phone number in mysql as integer, e.g. (123) 456-7890 is stored
> as 1234567890.
> though, in search form they usually type in a phone number with
> parenthesis/space/dashes. I have to extract numbers before I search
> through mysql.
> 
> currently, I use eregi_replace() function, several times, to do the job:
> eregi_replace(' ', '', $phone);
> eregi_replace('(', '', $phone);
> eregi_replace(')', '', $phone);
> eregi_replace('-', '', $phone);
> and it works fine.
> 
> but, is there any better way? more "fancy"? :)

str_replace would do the job.
http://hu2.php.net/str_replace

$phone = str_replace(array(' ','(',')','-'), '', $phone);

greets
Zoltán Németh

> 
> thanks for any help.
> 
> -afan
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] excluding parenthesis, space and dashes from phone number

2007-11-30 Thread Jochem Maas
afan pasalic wrote:
> hi,
> I store phone number in mysql as integer, e.g. (123) 456-7890 is stored
> as 1234567890.
> though, in search form they usually type in a phone number with
> parenthesis/space/dashes. I have to extract numbers before I search
> through mysql.
> 
> currently, I use eregi_replace() function, several times, to do the job:
> eregi_replace(' ', '', $phone);
> eregi_replace('(', '', $phone);
> eregi_replace(')', '', $phone);
> eregi_replace('-', '', $phone);

side note: if you are doing simple string relacement (as in the code above)
don't use regular expression functionality to do it, it a waste.

the above code will work the same if you replace 'eregi_replace' with 
'str_replace'

> and it works fine.
> 
> but, is there any better way? more "fancy"? :)

see TGs example. I recommend doing some study on regexps - knowing abit about
them and how to write a basic regexp is an invaluable tool.

> 
> thanks for any help.
> 
> -afan
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] excluding parenthesis, space and dashes from phone number

2007-11-30 Thread TG

I suck at regex.. but found this a while ago.   Supposedly it'll strip all 
non-numeric characters, so I've used it for phone #'s and SSNs:

preg_replace ('/[^\d]+/s', '', $var)

-TG

- Original Message -
From: afan pasalic <[EMAIL PROTECTED]>
To: php-general 
Date: Fri, 30 Nov 2007 08:44:38 -0500
Subject: [PHP] excluding parenthesis, space and dashes from phone number

> hi,
> I store phone number in mysql as integer, e.g. (123) 456-7890 is stored
> as 1234567890.
> though, in search form they usually type in a phone number with
> parenthesis/space/dashes. I have to extract numbers before I search
> through mysql.
> 
> currently, I use eregi_replace() function, several times, to do the job:
> eregi_replace(' ', '', $phone);
> eregi_replace('(', '', $phone);
> eregi_replace(')', '', $phone);
> eregi_replace('-', '', $phone);
> and it works fine.
> 
> but, is there any better way? more "fancy"? :)
> 
> thanks for any help.
> 
> -afan
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Join question [solved]

2007-11-30 Thread Daniel Brown
On Nov 29, 2007 11:17 PM, Robert Cummings <[EMAIL PROTECTED]> wrote:
> On Fri, 2007-11-30 at 14:00 +1100, Chris wrote:
> > > Out of curiosity, what SQL server (and version) are you using? I
> > > currently have MySQL 5.0.33 on my dev box and I had no problem with the
> > > query I gave you. Perhaps it's a version issue. There really shouldn't
> > > be a problem updating a table that also occurs in the select query since
> > > the select query should take place before the insert.
> >
> > He wasn't doing an insert/select, he was doing an update with two tables
> > joined together.
>
> He was doing an update/select and an insert/select. And the query I sent
> performed the insert/select without problem on my system. A similar
> query would have done the update/select. The fact that the select
> portion required a join doesn't change anything.
>
> > 
> >
> > I thought that --
> >
> > UPDATE user1 u1, user2 u2
> > SET u1.login = u2.login, u1.password = u2.password
> > WHERE u1.username = u2.username
> >
> > -- would work, but it don't.
>
> Wrong query for either of the needs :)
>
> Cheers,
> Rob.
> --
> ...
> SwarmBuy.com - http://www.swarmbuy.com
>
> Leveraging the buying power of the masses!
> ...
>
> --
>
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Rob,

The version difference is probably right on the nose.  If I
remember correctly, you couldn't do that in the long-popular 3.23,
which *gasp!* is still used by some web hosts, believe it or not.

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Join question

2007-11-30 Thread Daniel Brown
On Nov 30, 2007 8:08 AM, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Crayon Shin Chan wrote:
> > On Friday 30 November 2007, Robert Cummings wrote:
> >
> >> That's an amusing statement. I took a peek back in time and noticed
> >> that in the past 5 months you've only made two on-topic useful posts to
> >> the PHP General list-- and they were both for the same thread.
> >
> > If you have that much free time on your hands, should you not be looking
> > for my off-topic posts so you can prove a point?
>
> my guess it took less time to search for 'Crayon' in his mail archive than
> it took you to write the sentence.
>
> >
> > Or are you saying that one needs to make a lot of on-topic posts to build
> > up credit in order to be able to make off-topic posts?
>
> aparently Rob wasn't saying this ... but I would, regardless the OP (tedd) has
> earned his keep so to speak (and probably taken more shit than you in the 
> process
> without resorting to troll-like behaviour) - this is proved by the fact that
> people like Rob are helping him with something that is not strictly on topic.
>
> besides which it's rather pointless telling someone to go elsewhere for help
> when they already got the help and posted that they had solved the problem.
>
>
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

I was tempted to flame Tedd just because he's Tedd.  ;-P

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] excluding parenthesis, space and dashes from phone number

2007-11-30 Thread afan pasalic
hi,
I store phone number in mysql as integer, e.g. (123) 456-7890 is stored
as 1234567890.
though, in search form they usually type in a phone number with
parenthesis/space/dashes. I have to extract numbers before I search
through mysql.

currently, I use eregi_replace() function, several times, to do the job:
eregi_replace(' ', '', $phone);
eregi_replace('(', '', $phone);
eregi_replace(')', '', $phone);
eregi_replace('-', '', $phone);
and it works fine.

but, is there any better way? more "fancy"? :)

thanks for any help.

-afan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Question about urlencode....

2007-11-30 Thread Colin Guthrie
TG wrote:
> Unless your URL is more complicated than your example, you shouldn't need to 
> use urlencode() at all.   You'd need to use it in a case where your string 
> may contain characters that aren't valid in URLs like spaces and such:
> 
> $baseurl = "http://www.somesearchsite.com/search=";;
> $searchfor = "Grace O'Mally";
> 
> $searchurl = $baseurl . urlencode($searchfor);
> 
> Since you set your URL explicitly and it's not something entered by a user, 
> you shouldn't need it.
> 
> Try that and see if it fixes your other problem with double encoding.. or at 
> least gives a better clue as to where it's coming from.


Unfortunately the URLs are of arbitrary complicatedness ;)

Simple CMS system. Can view a profile page of an "entry" and click
through to their website.

I have a leave page that tracks how many clickthroughs.

The URL the user entered could be e.g.
"http://www.site.com/?a=b&something=else";

So if I were to not URL encode the URL I would get an exit link of:
/leave.php?url=http://www.site.com/?a=b&something=else&entry_id=123

As you can see the entry id is now confuses with the original URL and
the fact that there are two ?'s in the query is not particularly nice
either.

So AFAICT I *have* to URL encode them.

I think the only thing I can do is detect the URL starting with
"http[s]%" in the leave.php file and keep decoding until it doesn't

Seems really hick but what other option is there other than carefully
explaining to google bot to stop doubly encoding things thank you very
much

Col

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Join question

2007-11-30 Thread Jochem Maas
Crayon Shin Chan wrote:
> On Friday 30 November 2007, Robert Cummings wrote:
> 
>> That's an amusing statement. I took a peek back in time and noticed
>> that in the past 5 months you've only made two on-topic useful posts to
>> the PHP General list-- and they were both for the same thread.
> 
> If you have that much free time on your hands, should you not be looking 
> for my off-topic posts so you can prove a point?

my guess it took less time to search for 'Crayon' in his mail archive than
it took you to write the sentence.

> 
> Or are you saying that one needs to make a lot of on-topic posts to build 
> up credit in order to be able to make off-topic posts?

aparently Rob wasn't saying this ... but I would, regardless the OP (tedd) has
earned his keep so to speak (and probably taken more shit than you in the 
process
without resorting to troll-like behaviour) - this is proved by the fact that
people like Rob are helping him with something that is not strictly on topic.

besides which it's rather pointless telling someone to go elsewhere for help
when they already got the help and posted that they had solved the problem.

> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Rewind foreach loop

2007-11-30 Thread Jochem Maas
Jeffery Fernandez wrote:
> Hi all,
> 
> Is it possible to rewind a foreach loop? eg:
> 
> 
> $numbers = array(0,1,2,3,4,5,6,7,8,9,10);
> 
> foreach ($numbers as $index => $value)
> {
> if ($value == 5)
> {
> prev($numbers);
> }
> echo "Value: $value" . PHP_EOL;
> }

this might give you an[other] idea ... note it's
an infinite loop - watch out for those.

do {
foreach (array(0,1,2,3,4,5,6,7,8,9,10) as $k => $v) {
if ($v == 5) continue 2;
echo $v, PHP_EOL;
}
} while (true);

> 
> The above doesn't seem to work. In one of my scenarios, when I encounter and 
> error in a foreach loop, I need the ability to rewind the array pointer by 
> one. How can I achieve this?
> 
> regards,
> Jeffery

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php