Re: [PHP] PDO Transaction

2013-03-16 Thread Lester Caine
Simon Dániel wrote: 2013/3/15 Lester Caine Simon Dániel wrote: Hi, I have a trouble with PDO transactions. I would like to start using transactions, but I am not familiar with it. I have got a 'There is no active transaction' exception, however, I am using beginTransaction method, and also

Re: [PHP] PDO Transaction

2013-03-16 Thread Simon Dániel
2013/3/15 Lester Caine > Simon Dániel wrote: > >> Hi, >> >> I have a trouble with PDO transactions. >> >> I would like to start using transactions, but I am not familiar with it. I >> have got a 'There is no active transaction' exception, however, I am using >> beginTransaction method, and also I

Re: [PHP] PDO Transaction

2013-03-15 Thread Lester Caine
Simon Dániel wrote: Hi, I have a trouble with PDO transactions. I would like to start using transactions, but I am not familiar with it. I have got a 'There is no active transaction' exception, however, I am using beginTransaction method, and also I have set PDO::ATTR_AUTOCOMMIT to false right

RE: [PHP] PDO question

2012-11-29 Thread admin
> -Original Message- > From: Jim Lucas [mailto:li...@cmsws.com] > Sent: Wednesday, November 28, 2012 9:23 PM > To: ad...@buskirkgraphics.com > Cc: php-general@lists.php.net > Subject: Re: [PHP] PDO question > > On 11/28/2012 12:58 PM, ad...@buskirkgraphics.com wr

Re: [PHP] PDO question

2012-11-28 Thread Fatih P.
On Wed, Nov 28, 2012 at 9:22 PM, Jim Lucas wrote: > On 11/28/2012 12:58 PM, ad...@buskirkgraphics.com wrote: > >> >> Guys, >> I am not quiet sure what is happening but every time i try to connect to a >> remote host it refers back to localhost. >> >> $pdo = new PDO('mysql:host=171.16.23.44;**dbna

Re: [PHP] PDO question

2012-11-28 Thread Jim Lucas
On 11/28/2012 12:58 PM, ad...@buskirkgraphics.com wrote: Guys, I am not quiet sure what is happening but every time i try to connect to a remote host it refers back to localhost. $pdo = new PDO('mysql:host=171.16.23.44;dbname=test', 'user','password'); ERROR: Access denied for user 'user'@'loc

Re: [PHP] PDO mysql Connection issue

2012-11-28 Thread Admin
> On Wednesday, November 28, 2012 at 4:50 PM, ad...@buskirkgraphics.com wrote: >> I am having a PDO mysql connection issue I cant explain. >> >> On server server1.mydomain.com (http://server1.mydomain.com) >> I have a test script >> > $pdo = new PDO('mysql:host=171.16.23.44;dbname=test', 'user','

Re: [PHP] PDO mysql Connection issue

2012-11-28 Thread Mike Mackintosh
On Wednesday, November 28, 2012 at 4:50 PM, ad...@buskirkgraphics.com wrote: > I am having a PDO mysql connection issue I cant explain. > > On server server1.mydomain.com (http://server1.mydomain.com) > I have a test script > $pdo = new PDO('mysql:host=171.16.23.44;dbname=test', 'user','password'

Re: [PHP] PDO

2012-10-22 Thread Lester Caine
Silvio Siefke wrote: i found the mistake, i have forgetten write the new path for the sqlite database. Just been caught with a similar problem. Had moved a working site from windows to linux and it stopped serving up the swf files. Turns out the file has a hardcoded path with upper and lower

Re: [PHP] PDO

2012-10-22 Thread Silvio Siefke
Hello, i found the mistake, i have forgetten write the new path for the sqlite database. Thx Silvio -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PDO

2012-10-22 Thread Adam Richardson
On Mon, Oct 22, 2012 at 5:27 PM, Silvio Siefke wrote: > Hello, > > i have built php 5.4.7 on Ubuntu with the configure Arguments like on my > Gentoo System. But on Gentoo run the website without Problems, under Ubuntu > want not work. I become in error.log: > > [22-Oct-2012 21:15:00 UTC] PHP Fatal

Re: [PHP] PDO

2012-10-22 Thread Ashley Sheridan
On Mon, 2012-10-22 at 23:27 +0200, Silvio Siefke wrote: > Hello, > > i have built php 5.4.7 on Ubuntu with the configure Arguments like on my > Gentoo System. But on Gentoo run the website without Problems, under Ubuntu > want not work. I become in error.log: > > [22-Oct-2012 21:15:00 UTC] PHP

Re: [PHP] PDO

2012-10-22 Thread Nathan Nobbe
On Mon, Oct 22, 2012 at 3:27 PM, Silvio Siefke wrote: > Hello, > > i have built php 5.4.7 on Ubuntu with the configure Arguments like on my > Gentoo System. But on Gentoo run the website without Problems, under Ubuntu > want not work. I become in error.log: > > [22-Oct-2012 21:15:00 UTC] PHP Fata

Re: [PHP] PDO: extend or encapsulate?

2012-07-15 Thread tamouse mailing lists
On Sun, Jul 15, 2012 at 5:50 AM, shiplu wrote: > From OOP point of view. > > Use encapsulation: > When a class has a "has-a" relation-ship with other class you should use > encapsulation. For example, If MyDB is a class that "has-a" pdo driver in > it, then PDO will be encapsulated inside MyDB cla

Re: [PHP] PDO: extend or encapsulate?

2012-07-15 Thread shiplu
>From OOP point of view. Use encapsulation: When a class has a "has-a" relation-ship with other class you should use encapsulation. For example, If MyDB is a class that "has-a" pdo driver in it, then PDO will be encapsulated inside MyDB class. This is also called containment. MyDB should contain P

Re: [PHP] PDO: extend or encapsulate?

2012-07-14 Thread Marco Behnke
Am 14.07.12 10:09, schrieb Tony Marston: > wrote in message > news:1535031289.371987.1342162338279.javamail.open-xcha...@email.1und1.de... >> >> >> >> >> tamouse mailing lists hat am 13. Juli 2012 >> um 07:06 >> geschrieben: >> >>> It's Friday, so... >>> >>> Yes, it's true, I have just started loo

Re: [PHP] PDO: extend or encapsulate?

2012-07-14 Thread Lester Caine
tamouse mailing lists wrote: I am rather agreeing with both of you. Back in the days I used to poke at Java, one of the caveats was to only inherit from abstract classes, and encapsulate final classes. It does make more sense to me that way. One option is to keep both drivers available ... ADOd

Re: [PHP] PDO: extend or encapsulate?

2012-07-14 Thread Tony Marston
wrote in message news:1535031289.371987.1342162338279.javamail.open-xcha...@email.1und1.de... tamouse mailing lists hat am 13. Juli 2012 um 07:06 geschrieben: It's Friday, so... Yes, it's true, I have just started looking at using PDO instead of mysqli -- a bit behind the times... My q

Re: [PHP] PDO: extend or encapsulate?

2012-07-14 Thread tamouse mailing lists
On Sat, Jul 14, 2012 at 12:04 AM, Paul M Foster wrote: > On Fri, Jul 13, 2012 at 12:06:22AM -0500, tamouse mailing lists wrote: > >> It's Friday, so... >> >> Yes, it's true, I have just started looking at using PDO instead of >> mysqli -- a bit behind the times... >> >> My question at this stage,

Re: [PHP] PDO: extend or encapsulate?

2012-07-13 Thread Paul M Foster
On Fri, Jul 13, 2012 at 12:06:22AM -0500, tamouse mailing lists wrote: > It's Friday, so... > > Yes, it's true, I have just started looking at using PDO instead of > mysqli -- a bit behind the times... > > My question at this stage, is do people tend to extend the PDO class > for their own use,

Re: [PHP] PDO: extend or encapsulate?

2012-07-12 Thread ma...@behnke.biz
tamouse mailing lists hat am 13. Juli 2012 um 07:06 geschrieben: > It's Friday, so... > > Yes, it's true, I have just started looking at using PDO instead of > mysqli -- a bit behind the times... > > My question at this stage, is do people tend to extend the PDO class > for their own use, or e

Re: [PHP] PDO Prevent duplicate field names?

2012-07-03 Thread tamouse mailing lists
On Mon, Jul 2, 2012 at 5:38 PM, Scott Baker wrote: > It was my mistake, and the SQL was easily fixed. But it woulda been nice > to have PHP realize there was a dupe when it was building that array to > return to me. This is just not a province of PHP. What sort of behaviour would one expect PHP t

Re: [PHP] PDO Prevent duplicate field names?

2012-07-02 Thread Jim Lucas
On 07/02/2012 03:38 PM, Scott Baker wrote: On 07/02/2012 03:34 PM, Matijn Woudt wrote: Why the would you want to return 2 columns with the same name? To be short, there's no such function, so you have to: 1) Rename one of the columns 2) or, use fetch_row with numerical indexes instead of fe

Re: [PHP] PDO Prevent duplicate field names?

2012-07-02 Thread Matijn Woudt
On Tue, Jul 3, 2012 at 12:38 AM, Scott Baker wrote: > On 07/02/2012 03:34 PM, Matijn Woudt wrote: >> Why the would you want to return 2 columns with the same name? >> To be short, there's no such function, so you have to: >> 1) Rename one of the columns >> 2) or, use fetch_row with numerical

Re: [PHP] PDO Prevent duplicate field names?

2012-07-02 Thread Scott Baker
On 07/02/2012 03:34 PM, Matijn Woudt wrote: > Why the would you want to return 2 columns with the same name? > To be short, there's no such function, so you have to: > 1) Rename one of the columns > 2) or, use fetch_row with numerical indexes instead of fetch_assoc. My "real world" scenario w

Re: [PHP] PDO Prevent duplicate field names?

2012-07-02 Thread Matijn Woudt
On Tue, Jul 3, 2012 at 12:25 AM, Scott Baker wrote: > $sql = "SELECT First, Last, Age, 'Foobar' AS Last;"; > > This is a simplified example of a SQL query where we're returning two > fields with the same name (Last). When I do a fetch_assoc with this > query I only get three fields, as the second

Re: [PHP] PDO Prepared Statements and stripslashes

2010-12-21 Thread Rico Secada
On Tue, 21 Dec 2010 10:32:21 -0500 Adam Richardson wrote: > 1. Turn off magic_quotes_gpc if on, as its use has been deprecated. > 2. Use prepared statements. > 3. Don't worry about stripping slashes ever again :) Thank you for a very enlightening answer. I guess I misunderstood the "PDO automati

Re: [PHP] PDO Prepared Statements and stripslashes

2010-12-21 Thread Adam Richardson
On Mon, Dec 20, 2010 at 11:31 PM, Rico Secada wrote: > Hi. > > In an article about SQL Injection by Chris Shiflett he mentions the > following in a comment: "The process of escaping should preserve data, > so it should never be necessary to reverse it. When I'm auditing an > application, things l

Re: [PHP] PDO Prepared Statements and stripslashes

2010-12-20 Thread Ravi Gehlot
Hello, The plug-in PDO has nothing to do with the backslashes being inserted into the database. The backslashes are used to escape characters like in D's...it would show D's. That's the safe behavior of it. You can change your programming code to fix that. Ravi. On Tue, Dec 21, 2010

Re: [PHP] PDO Prepared Statements and stripslashes

2010-12-20 Thread Rico Secada
On Tue, 21 Dec 2010 00:32:19 -0500 Paul M Foster wrote: > On Tue, Dec 21, 2010 at 05:31:15AM +0100, Rico Secada wrote: > > > Hi. > > > > In an article about SQL Injection by Chris Shiflett he mentions the > > following in a comment: "The process of escaping should preserve > > data, so it shoul

Re: [PHP] PDO Prepared Statements and stripslashes

2010-12-20 Thread Paul M Foster
On Tue, Dec 21, 2010 at 05:31:15AM +0100, Rico Secada wrote: > Hi. > > In an article about SQL Injection by Chris Shiflett he mentions the > following in a comment: "The process of escaping should preserve data, > so it should never be necessary to reverse it. When I'm auditing an > application,

Re: [PHP] PDO: good, popular?

2010-12-15 Thread Nicholas Kell
On Dec 14, 2010, at 5:45 PM, Govinda wrote: >> In previous experience with questions such as these, you will get >> several types of individual responses to usages of the software. Some >> good, some bad, depending on the experience level of the commenter >> with both the language and the code in

Re: [PHP] PDO: good, popular?

2010-12-14 Thread Larry Garfield
On Tuesday, December 14, 2010 1:02:33 pm Lester Caine wrote: > la...@garfieldtech.com wrote: > > I'm the DB maintainer for Drupal 7, and we rebuilt our entire DB layer > > on top of PDO. It's a rather nice API, although as others have noted it > > does not abstract away SQL entirely; it abstracts

Re: [PHP] PDO: good, popular?

2010-12-14 Thread Paul M Foster
On Tue, Dec 14, 2010 at 03:10:56AM -0800, Sam Smith wrote: > Searching for "PHP CRUD" in hopes of learning the best way to access > databases and to use PEAR or what I came across PDO. > > I want to know the communities opinion of PDO: everyone uses it or no one > uses it or it's great or what?

Re: [PHP] PDO: good, popular?

2010-12-14 Thread Govinda
In previous experience with questions such as these, you will get several types of individual responses to usages of the software. Some good, some bad, depending on the experience level of the commenter with both the language and the code in question. It's a combination of your current understand

Re: [PHP] PDO: good, popular?

2010-12-14 Thread Lester Caine
la...@garfieldtech.com wrote: I'm the DB maintainer for Drupal 7, and we rebuilt our entire DB layer on top of PDO. It's a rather nice API, although as others have noted it does not abstract away SQL entirely; it abstracts the API calls you need to use to get to SQL. We then built a layer on to

Re: [PHP] PDO: good, popular?

2010-12-14 Thread Adam Richardson
On Tue, Dec 14, 2010 at 6:10 AM, Sam Smith wrote: > Searching for "PHP CRUD" in hopes of learning the best way to access > databases and to use PEAR or what I came across PDO. > > I want to know the communities opinion of PDO: everyone uses it or no one > uses it or it's great or what? > > Thanks

Re: [PHP] PDO: good, popular?

2010-12-14 Thread la...@garfieldtech.com
I'm the DB maintainer for Drupal 7, and we rebuilt our entire DB layer on top of PDO. It's a rather nice API, although as others have noted it does not abstract away SQL entirely; it abstracts the API calls you need to use to get to SQL. We then built a layer on top of that which does abstrac

Re: [PHP] PDO: good, popular?

2010-12-14 Thread Richard Quadling
On 14 December 2010 15:45, David Hutto wrote: > From my experience with several languages, once you know the basics, > even if you do re-invent the 'wheel', so did firestone,michelin, and > goodyear, and they're not complaining. And you'll feel better for > reinventing, than using someone elses.

Re: [PHP] PDO: good, popular?

2010-12-14 Thread David Hutto
In other words, in ten years from now, even the advisors you get today will rethink their answers with 20/20/hindsight, and not think about your ignorance of technology, but their own. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PDO: good, popular?

2010-12-14 Thread Richard Quadling
On 14 December 2010 11:10, Sam Smith wrote: > Searching for "PHP CRUD" in hopes of learning the best way to access > databases and to use PEAR or what I came across PDO. > > I want to know the communities opinion of PDO: everyone uses it or no one > uses it or it's great or what? > > Thanks > If

Re: [PHP] PDO: good, popular?

2010-12-14 Thread David Hutto
On Tue, Dec 14, 2010 at 6:10 AM, Sam Smith wrote: > Searching for "PHP CRUD" in hopes of learning the best way to access > databases and to use PEAR or what I came across PDO. > > I want to know the communities opinion of PDO: everyone uses it or no one > uses it or it's great or what? In previou

[PHP] Re: [PDO] Re: [PHP] PDO working via Apache but not at the command line?

2010-10-18 Thread Stanley Sufficool
Sounds like the error message "SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (severity 9)" could be more informative, but I think this is returned by FreeTDS, not PDO. On Mon, Oct 18, 2010 at 7:35 PM, Scott Baker wrote: > On 10/18/2010 06:27 PM, Wez Furlong w

[PHP] Re: [PDO] Re: [PHP] PDO working via Apache but not at the command line?

2010-10-18 Thread Scott Baker
On 10/18/2010 06:27 PM, Wez Furlong wrote: > Things to check: > > - Environment: what env vars are set or not set in your Apache vs. CLI > - Owner: are you running as the same user as your web server? > - Do you or the web server have some kind of "rc" file that might impact > how things run? Wez

[PHP] Re: [PDO] Re: [PHP] PDO working via Apache but not at the command line?

2010-10-18 Thread Wez Furlong
Things to check: - Environment: what env vars are set or not set in your Apache vs. CLI - Owner: are you running as the same user as your web server? - Do you or the web server have some kind of "rc" file that might impact how things run? Suggestion: Use "sudo -u webserverusername -s" to run

Re: [PHP] PDO working via Apache but not at the command line?

2010-10-18 Thread Scott Baker
On 10/18/2010 02:17 PM, a...@ashleysheridan.co.uk wrote: It's most likely because both cli and web modules are using different php.ini config files. See what the output of a phpinfo() call in both browser and command line. I didn't even think about it parsing different php.ini files. Checking

Re: [PHP] PDO working via Apache but not at the command line?

2010-10-18 Thread a...@ashleysheridan.co.uk
It's most likely because both cli and web modules are using different php.ini config files. See what the output of a phpinfo() call in both browser and command line. Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: "Scott Baker" Date: Mon, Oct 18, 2010 21:20 Subject:

Re: [PHP] PDO and UPDATE problem

2010-07-21 Thread Peter Lind
On 21 July 2010 15:04, Sky Gunning wrote: > Hello > > I have a problem with a update using PDO. > (learning atm and updating a php class to use PDO) > >    private function updateUser($id) >    { >        $date = mktime(); > >        $DB = Db::getInstance(); > >        $stmt = $DB->prepare('"UPDAT

RE: [PHP] PDO fetch_obj - question

2009-04-16 Thread MEM
Thanks. I will see. The script for my database was been generated so, I will doublecheck this uppercase "issue"... Regards, Márcio 2009/4/15 Thodoris Hi there, I’ve made a fetch_obj and, as stated on some sites, it returns a anonymous object where the properties will have the name of our col

Re: [PHP] PDO fetch_obj - question

2009-04-15 Thread talofo talofo
Thanks. I will see. The script for my database was been generated so, I will doublecheck this uppercase "issue"... Regards, Márcio 2009/4/15 Thodoris > > Hi there, I’ve made a fetch_obj and, as stated on some sites, it returns >> a anonymous >> object where the properties will have the name o

Re: [PHP] PDO fetch_obj - question

2009-04-15 Thread Thodoris
Hi there, I’ve made a fetch_obj and, as stated on some sites, it returns a anonymous object where the properties will have the name of our columns database. However, when I do this, I notice that instead of giving me the column names as they are typed on the DB I get them uppercase. So, wh

Re: [PHP] PDO buffered query problem

2009-02-24 Thread Chris
Thodoris wrote: Stewart Duncan wrote: Hi there, I'm having some serious problems with the PHP Data Object functions. I'm trying to loop through a sizeable result set (~60k rows, ~1gig) using a buffered query to avoid fetching the whole set. No matter what I do, the script just hangs on th

Re: [PHP] PDO buffered query problem

2009-02-24 Thread Thodoris
Stewart Duncan wrote: Hi there, I'm having some serious problems with the PHP Data Object functions. I'm trying to loop through a sizeable result set (~60k rows, ~1gig) using a buffered query to avoid fetching the whole set. No matter what I do, the script just hangs on the PDO::query() -

Re: [PHP] PDO buffered query problem

2009-02-23 Thread Chris
Stewart Duncan wrote: Hi there, I'm having some serious problems with the PHP Data Object functions. I'm trying to loop through a sizeable result set (~60k rows, ~1gig) using a buffered query to avoid fetching the whole set. No matter what I do, the script just hangs on the PDO::query() - it

Re: [PHP] pdo and dabase schema

2008-10-14 Thread Chris
Alain Roger wrote: Hi, is there a way with PDO class to not have: - to execute a simple SET search_path TO myschema; can you alter the postgres users path? alter user set search_path to new_schema, current_schemas(); or some variation on that. - and after to fletch another SQL request, li

Re: [PHP] PDO, sqlite write requests (INSERT) don't working

2008-08-20 Thread Ashley Sheridan
Hi KLEIN, I think the problem is where you are connecting to your database. I've not used SQL lite before, but the function spec says that you have too many arguments. It suggests connecting like this: if ($db = new SQLiteDatabase('filename')) Also, do you need to specify the sqlite: protocol bef

Re: [PHP] pdo compilation question

2008-08-19 Thread Jochem Maas
Thijs Lensselink schreef: Quoting Tim Rupp <[EMAIL PROTECTED]>: ... Thanks in advance, Tim you are loading extensions of an older PHP version. Do an ls -als on /usr/local/lib/php. you will find a directory with a higher date. That's your new extension path. Just change the location in

Re: [PHP] pdo compilation question

2008-08-19 Thread Thijs Lensselink
Quoting Tim Rupp <[EMAIL PROTECTED]>: Hi list, I hope this is the right area to ask, I'm trying to compile PDO support in 5.2.6 and am following the instructions here http://us2.php.net/manual/en/pdo.installation.php My compile line is the following ./configure --enable-force-cgi-redirect

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-05 Thread Andrew Ballard
On Mon, Aug 4, 2008 at 1:36 AM, Larry Garfield <[EMAIL PROTECTED]> wrote: > Hi folks. I am trying to figure out the best way to handle an interesting > issue in PDO prepared statements. Consider: > > $search = 'mystring'; > > $stmt = $dbh->prepare("SELECT * FROM mytable WHERE myfield LIKE :myfiel

[PHP] [PHP-DEV] Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-05 Thread Lester Caine
Sorry - switched address to the wrong list :( *I* hate reply not going to the right place - but one of these days I switch to something that just ignores the on board miss direction ;) Larry Garfield wrote: I'm building a multi-database system, although my main targets are MySQL, Postgres, and

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Larry Garfield
I'm building a multi-database system, although my main targets are MySQL, Postgres, and SQLite. How would those handle something like "a string that ends in 100%"? On Monday 04 August 2008 6:18:24 pm Asher Snyder wrote: > Depending on what database you're using you might be able to use LIKE >

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Asher Snyder
Depending on what database you're using you might be able to use LIKE while maintaining security. For instance PostgreSQL has the functions quote_ident(), and quote_literal() which would allow you to use LIKE since these functions would automatically make the string suitable for comparison.

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Adam Richardson
Like I said, I'm not 'especially pleased' with any idea up until now. I'm certainly open to any other ideas. Adam On Mon, Aug 4, 2008 at 6:57 PM, Larry Garfield <[EMAIL PROTECTED]>wrote: > > Hm. So your solution is "don't use LIKE"? I can't say I'm wild about > that. :-/ > > --Larry Garfield

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Larry Garfield
Hm. So your solution is "don't use LIKE"? I can't say I'm wild about that. :-/ --Larry Garfield On Mon, 4 Aug 2008 15:49:52 -0400, "Adam Richardson" <[EMAIL PROTECTED]> wrote: > Larry, > > I agree that having to escape values in a stored procedure does run > counter > to expectations. It's l

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Adam Richardson
Larry, I agree that having to escape values in a stored procedure does run counter to expectations. It's likely other developers have the potential for short-circuiting their LIKE conditions without realizing it. I've dealt with this issue, too, and haven't been especially pleased with any of th

RE: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Boyd, Todd M.
> -Original Message- > From: Andrew Ballard [mailto:[EMAIL PROTECTED] > Sent: Monday, August 04, 2008 10:49 AM > To: PHP General list > Subject: Re: [PHP] PDO prepared statements and LIKE escaping > > On Mon, Aug 4, 2008 at 11:35 AM, Larry Garfield > <[EMAIL PR

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Larry Garfield
On Mon, 4 Aug 2008 11:48:39 -0400, "Andrew Ballard" <[EMAIL PROTECTED]> wrote: > On Mon, Aug 4, 2008 at 11:35 AM, Larry Garfield <[EMAIL PROTECTED]> > wrote: >> >> On Mon, 04 Aug 2008 08:33:44 +0200, Per Jessen <[EMAIL PROTECTED]> wrote: >>> Larry Garfield wrote: >>> IIRC, the way in SQL to c

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Andrew Ballard
On Mon, Aug 4, 2008 at 11:35 AM, Larry Garfield <[EMAIL PROTECTED]> wrote: > > On Mon, 04 Aug 2008 08:33:44 +0200, Per Jessen <[EMAIL PROTECTED]> wrote: >> Larry Garfield wrote: >> >>> IIRC, the way in SQL to circumvent that is to convert "100%" into >>> "100%%". However, that does rather defeat th

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Per Jessen
Larry Garfield wrote: > Actually in most cases in PHP you don't get much performance. Exactly. > What you do get is added security, because prepared statements are > cleaner than cleaner and more reliable than string escaping. Of > course, then we run into the % problem above. I don't really

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-04 Thread Larry Garfield
On Mon, 04 Aug 2008 08:33:44 +0200, Per Jessen <[EMAIL PROTECTED]> wrote: > Larry Garfield wrote: > >> IIRC, the way in SQL to circumvent that is to convert "100%" into >> "100%%". However, that does rather defeat the purpose of a prepared >> statement if I have to do my own escaping anyway, does

Re: [PHP] PDO prepared statements and LIKE escaping

2008-08-03 Thread Per Jessen
Larry Garfield wrote: > IIRC, the way in SQL to circumvent that is to convert "100%" into > "100%%". However, that does rather defeat the purpose of a prepared > statement if I have to do my own escaping anyway, does it not? Depends on what you perceive the purpose of the prepared statement to b

Re: [PHP] PDO Question. Number of rows returned

2008-07-13 Thread Bastien Koert
On Sun, Jul 13, 2008 at 11:12 AM, Stephen <[EMAIL PROTECTED]> wrote: > Bastien Koert wrote: > > On Sun, Jul 13, 2008 at 10:30 AM, Stephen <[EMAIL PROTECTED]> <[EMAIL > PROTECTED]> wrote: > > > > Kevin Waterson wrote: > > > > I am switching to PDO and can't find an equivalent to mysql_num_rows.

Re: [PHP] PDO Question. Number of rows returned

2008-07-13 Thread Stephen
Bastien Koert wrote: On Sun, Jul 13, 2008 at 10:30 AM, Stephen <[EMAIL PROTECTED]> wrote: Kevin Waterson wrote: I am switching to PDO and can't find an equivalent to mysql_num_rows. Am I missing something silly? Or is there a change of thinking needed for PDO? How should I d

Re: [PHP] PDO Question. Number of rows returned

2008-07-13 Thread Bastien Koert
On Sun, Jul 13, 2008 at 10:30 AM, Stephen <[EMAIL PROTECTED]> wrote: > Kevin Waterson wrote: > >> I am switching to PDO and can't find an equivalent to mysql_num_rows. >>> >>> Am I missing something silly? >>> >>> Or is there a change of thinking needed for PDO? >>> >>> How should I determine how

Re: [PHP] PDO Question. Number of rows returned

2008-07-13 Thread Stephen
Kevin Waterson wrote: I am switching to PDO and can't find an equivalent to mysql_num_rows. Am I missing something silly? Or is there a change of thinking needed for PDO? How should I determine how many rows a query returned? PDO returns an array, sizeof/count will get you home I wou

Re: [PHP] PDO Question. Number of rows returned

2008-07-12 Thread Kevin Waterson
This one time, at band camp, Stephen <[EMAIL PROTECTED]> wrote: > I am switching to PDO and can't find an equivalent to mysql_num_rows. > > Am I missing something silly? > > Or is there a change of thinking needed for PDO? > > How should I determine how many rows a query returned? PDO returns

Re: [PHP] PDO::ATTR_TIMEOUT script specific?

2007-08-07 Thread Richard Lynch
On Thu, August 2, 2007 1:49 pm, Ken Tozier wrote: > I have a script that needs to get ad information from two different > sources, a primary and fallback. The primary source is a high traffic > (and poorly designed/unpartitioned MSSQL database) with millions of > records that gets locked up when 'c

Re: [PHP] PDO lastInsertID always returns zero for MySQL tables [SOLVED]

2007-08-05 Thread Ken Tozier
Disregard. After more head scratching I found that I was branching to the 'insert' handler without calling this->db->query($query). On Aug 5, 2007, at 9:18 PM, Ken Tozier wrote: Hi In the past, I always used mysql_insert_id() and never had a problem, but now that I'm using PDO, I'm find

Re: [PHP] pdo-oracle + nls_lang environment variable...

2007-05-17 Thread Miguel J. Jiménez
Javier Ruiz escribió: Hi, I'm using pdo-oci on php-5.2.2 against an oracle-10g server, using oracle-instantclient (compiled oracle with '--with-oci8=instantclient,/usr/lib/oracle/10.2.0.3/client/lib'). The problem...: I make a simple php script that makes a select from a table. The table contai

Re: [PHP] PDO and buffered queries

2007-04-01 Thread Larry Garfield
On Sunday 01 April 2007 3:09 pm, Jürgen Wind wrote: > Larry Garfield wrote: > > ...segfaults under PHP 5.1.6 ... > > php 5.1.5/6 was the source for many segfaults (f.e. using phpmyadmin) > better don't use it any more. See also: > http://bugs.php.net/bug.php?id=39036 Oh goodie. That only includes

Re: [PHP] PDO and buffered queries

2007-04-01 Thread Jürgen Wind
Larry Garfield wrote: > > ...segfaults under PHP 5.1.6 ... > php 5.1.5/6 was the source for many segfaults (f.e. using phpmyadmin) better don't use it any more. See also: http://bugs.php.net/bug.php?id=39036 -- View this message in context: http://www.nabble.com/PDO-and-buffered-queries-tf34

Re: [PHP] PDO and buffered queries

2007-04-01 Thread Larry Garfield
On Sunday 01 April 2007 3:42 am, Tijnema ! wrote: > > On Wednesday 28 March 2007 11:14 pm, Larry Garfield wrote: > > > HI all. The PHP.net manual is somewhat unclear on this point, so I > > > thought I'd ask here. Does PDO automatically buffer queries the way > > > that the mysql_* extension doe

Re: [PHP] PDO and buffered queries

2007-04-01 Thread Tijnema !
On 4/1/07, Larry Garfield <[EMAIL PROTECTED]> wrote: So there's no PDO experts out there, eh? :-( No, not really a PDO expert ;) On Wednesday 28 March 2007 11:14 pm, Larry Garfield wrote: > HI all. The PHP.net manual is somewhat unclear on this point, so I thought > I'd ask here. Does PDO a

Re: [PHP] pdo::lastInsertId() error with SQL Server

2007-03-31 Thread Richard Lynch
On Thu, March 29, 2007 12:57 pm, Sady Marcos wrote: > > hey.. > I am not obtaining use the function pdo::lastInsertId() with sql > My code: > > $db = new PDO("mssql:host=host;dbname=database","user","password"); > $sql = "INSERT INTO users(name,status) VALUES('username','1)"; Are you really mi

Re: [PHP] PDO and buffered queries

2007-03-31 Thread Larry Garfield
So there's no PDO experts out there, eh? :-( On Wednesday 28 March 2007 11:14 pm, Larry Garfield wrote: > HI all. The PHP.net manual is somewhat unclear on this point, so I thought > I'd ask here. Does PDO automatically buffer queries the way that the > mysql_* extension does, in order to allow

Re: [PHP] pdo::lastInsertId() error with SQL Server

2007-03-29 Thread Dan Shirah
use scope_identity() if you're using MS SQL Server 2000 or newer. scope_identity slects the last id within your current scope (The last record you entered in your current session) On 3/29/07, Sady Marcos <[EMAIL PROTECTED]> wrote: hey.. I am not obtaining use the function pdo::lastInsertId()

RE: [PHP] PDO mssql + multiple rowsets

2007-03-28 Thread Frank M. Kromann
It Is doable. The native mssql/dblib extension does support that features. I just have'nt had the time to code it for pdo_dblib. - Frank > I too have been having problems getting the PDO dblib for mssql to play > well (getting the same error actually). If you find a reason or work > around for i

RE: [PHP] PDO mssql + multiple rowsets

2007-03-28 Thread Ligaya A. Turmelle
I too have been having problems getting the PDO dblib for mssql to play well (getting the same error actually). If you find a reason or work around for it I would appreciate hearing about it. Thinking of going the odbc route myself if I can't get it to work. Respectfully, Ligaya Turmelle -

Re: [PHP] PDO database drivers

2007-02-20 Thread Jon Anderson
Sandy Keathley wrote: I upgraded PHP 5.2 => 5.2.1 and added PDO support. It installed the SQLLITE driver by default. I wanted to add the MYSQL driver. I ran pecl install PDO_MYSQL and it failed with an autoconf error. It probably depends on how you're installing PHP. If you're using a dist

Re: [PHP] PDO statement/resultset

2006-12-17 Thread Chris
David Duong wrote: Hi everyone, Let me know if there is a better place to post this. I am playing with the idea of creating a true (KISS) abstraction layer that makes full use of PHP5's OOP support. So logically it would make sense to make use PDO wherever possible, however, one of PDO's desi

Re: [PHP] PDO::prepare deallocate & PDOStatement::closeCursor()

2006-12-15 Thread Richard Lynch
On Fri, December 15, 2006 7:49 am, Yonatan Ben-Nes wrote: > 1. Let's say that I create the following prepared statement: > $PDOStatement = $DB_Conn->prepare("INSERT INTO test (name) values > (?)"); > And after 50,000 inserts (with > $PDOStatement->execute(array('somevalue'));) > I want the database

Re: [PHP] pdo and mysql 5

2006-11-14 Thread Curt Zirzow
On 11/10/06, jonathan <[EMAIL PROTECTED]> wrote: I know that PDO has drivers only for MySQL 3/4. Is anybody getting it work with MySQL 5. I'd like to try out the Zend Framework but our db uses MySQL 5. We could create a second db in 4.1 and run it with that but I'd rather not to. It's kinda su

Re: [PHP] PDO::PARAM_LOB and MySQL

2006-11-14 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-11-14 07:57:33 -0800: > I based this code off the example in the documentation: > > http://us2.php.net/manual/en/ref.pdo.php#AEN149844 (Example 12. Displaying > an image from a database) > > Any suggestions? It seems to be that it *should* be doing what I want, but >

Re: [PHP] pdo and mysql 5

2006-11-10 Thread Jon Anderson
jonathan wrote: I know that PDO has drivers only for MySQL 3/4. Is anybody getting it work with MySQL 5. I'd like to try out the Zend Framework but our db uses MySQL 5. We could create a second db in 4.1 and run it with that but I'd rather not to. It's kinda surprising how long MySQL 5 has

Re: [PHP] pdo and mysql 5

2006-11-10 Thread Curt Zirzow
On 11/10/06, jonathan <[EMAIL PROTECTED]> wrote: I know that PDO has drivers only for MySQL 3/4. Is anybody getting it work with MySQL 5. I'd like to try out the Zend Framework but our db uses MySQL 5. We could create a second db in 4.1 and run it with that but I'd rather not to. It's kinda su

Re: [PHP] PDO and PGSQL: ERROR: syntax error at or near "SET"

2006-08-07 Thread Richard Lynch
On Mon, August 7, 2006 6:48 am, Erik Gyepes wrote: > I'm trying to learn using PDO and PostgreSQL together a little bit and > I > have some problems with (I thinks, auto incrementing fields) > I have the following sample DB: > > CREATE TABLE users ( > uid SERIAL UNIQUE NOT NULL, My PostgreSQL know

Re: [PHP] PDO and PGSQL: ERROR: syntax error at or near "SET"

2006-08-07 Thread David Tulloh
Erik Gyepes wrote: > ... > $query = "INSERT INTO users SET uid = :uid, login = :login, password = > :password"; > ... > When running the script I get the following error message: Error!: > SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "SET" at > character 19 > The INSERT INT

Re: [PHP] PDO, Persistent Connections

2006-03-28 Thread Rasmus Lerdorf
Philip Thompson wrote: On Mar 28, 2006, at 10:23 AM, Jochem Maas wrote: Jarratt Ingram wrote: Hi, I have a little unusual question, we are currently looking into the new PDO extension with PHP5.1. We are currently use Mysql, InnoDB and transactions. What we would like to know if we use the

Re: [PHP] PDO, Persistent Connections

2006-03-28 Thread Philip Thompson
On Mar 28, 2006, at 10:23 AM, Jochem Maas wrote: Jarratt Ingram wrote: Hi, I have a little unusual question, we are currently looking into the new PDO extension with PHP5.1. We are currently use Mysql, InnoDB and transactions. What we would like to know if we use the PDO extension and pers

Re: [PHP] PDO, Persistent Connections

2006-03-28 Thread Jochem Maas
Jarratt Ingram wrote: Hi, I have a little unusual question, we are currently looking into the new PDO extension with PHP5.1. We are currently use Mysql, InnoDB and transactions. What we would like to know if we use the PDO extension and persistent connections, can we start a Transaction on one

  1   2   >