Re: [PHP] Quotes in querys

2009-01-15 Thread Thodoris
It is over head, but it caches the execution plan for multiple runs of the script. So different users with different data will use the same cached query on the database. Saving processing time. It also prevents SQL injection on the fly because you are indicating what data type each place

Re: [PHP] Quotes in querys

2009-01-14 Thread Chris
It is over head, but it caches the execution plan for multiple runs of the script. So different users with different data will use the same cached query on the database. Saving processing time. It also prevents SQL injection on the fly because you are indicating what data type each place holde

Re: [PHP] Quotes in querys

2009-01-14 Thread Ashley Sheridan
On Wed, 2009-01-14 at 15:24 -0500, Frank Stanovcak wrote: > "Ashley Sheridan" wrote in message > news:1231962521.3613.13.ca...@localhost.localdomain... > > On Wed, 2009-01-14 at 11:17 -0500, MikeP wrote: > >> Hello, > >> I am trying to get the following to work: > >> "Select Netid from Users wher

Re: [PHP] Quotes in querys

2009-01-14 Thread Frank Stanovcak
"Ashley Sheridan" wrote in message news:1231962521.3613.13.ca...@localhost.localdomain... > On Wed, 2009-01-14 at 11:17 -0500, MikeP wrote: >> Hello, >> I am trying to get the following to work: >> "Select Netid from Users where Netid = '$_SESSION[phpCAS][user]'" >> Netid is a string type. >> No

Re: [PHP] Quotes in querys

2009-01-14 Thread Ashley Sheridan
On Wed, 2009-01-14 at 11:17 -0500, MikeP wrote: > Hello, > I am trying to get the following to work: > "Select Netid from Users where Netid = '$_SESSION[phpCAS][user]'" > Netid is a string type. > No matter where of if I put the quotes, I still get array[phpCAS] not the > value. > If there is anyt

Re: [PHP] Quotes in querys

2009-01-14 Thread Kyle Terry
On Wed, Jan 14, 2009 at 9:11 AM, wrote: > > > Doesn't anybody use prepared statements these days? It even helps MySQL > > AND Oracle cache an execution plan... > > Forgive me if I'm wrong, but: > > Caching an execution plan for a prepared statement that is run only once in > the script is just ov

Re: [PHP] Quotes in querys

2009-01-14 Thread ceo
> Doesn't anybody use prepared statements these days? It even helps MySQL > AND Oracle cache an execution plan... Forgive me if I'm wrong, but: Caching an execution plan for a prepared statement that is run only once in the script is just overhead, no? Or can it actually re-use the same

Re: [PHP] Quotes in querys

2009-01-14 Thread Kyle Terry
On Wed, Jan 14, 2009 at 8:41 AM, MikeP wrote: > Thanks, Thats the kind of help I was looking for. > Mike > wrote in message > news:20090114162142.65944.qm...@o2.hostbaby.com... > > > > You can only interpolate ONE level of array or object indirection in a > > string. > > > > WORKS: > > "... $foo

Re: [PHP] Quotes in querys

2009-01-14 Thread MikeP
Thanks, Thats the kind of help I was looking for. Mike wrote in message news:20090114162142.65944.qm...@o2.hostbaby.com... > > You can only interpolate ONE level of array or object indirection in a > string. > > WORKS: > "... $foo[x] ..." > "... $foo->x ..." > > FAILS: > "... $foo[x][y] ..." > "

Re: [PHP] Quotes in querys

2009-01-14 Thread Eric Butera
On Wed, Jan 14, 2009 at 11:34 AM, MikeP wrote: > > ""Eric Butera"" wrote in message > news:6a8639eb0901140825h1d603d01i3ffcce919dca6...@mail.gmail.com... >> On Wed, Jan 14, 2009 at 11:17 AM, MikeP wrote: >>> Hello, >>> I am trying to get the following to work: >>> "Select Netid from Users where

Re: [PHP] Quotes in querys

2009-01-14 Thread MikeP
""Eric Butera"" wrote in message news:6a8639eb0901140825h1d603d01i3ffcce919dca6...@mail.gmail.com... > On Wed, Jan 14, 2009 at 11:17 AM, MikeP wrote: >> Hello, >> I am trying to get the following to work: >> "Select Netid from Users where Netid = '$_SESSION[phpCAS][user]'" >> Netid is a string

Re: [PHP] Quotes in querys

2009-01-14 Thread Eric Butera
On Wed, Jan 14, 2009 at 11:17 AM, MikeP wrote: > Hello, > I am trying to get the following to work: > "Select Netid from Users where Netid = '$_SESSION[phpCAS][user]'" > Netid is a string type. > No matter where of if I put the quotes, I still get array[phpCAS] not the > value. > If there is anyth

Re: [PHP] Quotes in querys

2009-01-14 Thread ceo
You can only interpolate ONE level of array or object indirection in a string. WORKS: "... $foo[x] ..." "... $foo->x ..." FAILS: "... $foo[x][y] ..." "... $foo->x->y ..." //almost for sure it fails, never tried... You can use curly braces in side a string to evaluate something: WOR

Re: [PHP] Quotes in querys

2009-01-14 Thread Robert Stankiewicz
I am trying to get the following to work: "Select Netid from Users where Netid = '$_SESSION[phpCAS][user]'" Netid is a string type. No matter where of if I put the quotes, I still get array[phpCAS] not the value. Maybe try this : $q = 'Select Netid from Users where Netid = "' . $_SESSION[p