Re: [nyphp-talk] Trying to decide between MDB2 and PHP PDO

2009-06-25 Thread Eddie Drapkin
On Fri, Jun 26, 2009 at 2:13 AM, Hans Zaunere wrote: >> >> Wait, are you advocating //against// prepared statements? >> > >> > Not at all, but when using mysql, you should emulate them.  I am >> > actually all for "prepared" style queries, if I ever see >> > "mysqli_real_escape_string" in someone's

Re: [nyphp-talk] Trying to decide between MDB2 and PHP PDO

2009-06-25 Thread Hans Zaunere
> >> Wait, are you advocating //against// prepared statements? > > > > Not at all, but when using mysql, you should emulate them.  I am > > actually all for "prepared" style queries, if I ever see > > "mysqli_real_escape_string" in someone's code, I immediately write the > > person off as clueless.

Re: [nyphp-talk] Trying to decide between MDB2 and PHP PDO

2009-06-25 Thread Konstantin Rozinov
On Thu, Jun 25, 2009 at 6:04 PM, John Campbell wrote: > On Thu, Jun 25, 2009 at 5:44 PM, Eddie Drapkin wrote: >> Wait, are you advocating //against// prepared statements? > > Not at all, but when using mysql, you should emulate them.  I am > actually all for "prepared" style queries, if I ever see

Re: [nyphp-talk] Trying to decide between MDB2 and PHP PDO

2009-06-25 Thread Hans Zaunere
> Hi, I work with Kevin. Our application needs to run on both mySQL and Oracle > so we are looking for portability. We currently are using PEAR DB and we are > looking into moving to MDB2 or PDO so we thought it would be a good idea to > test performance before we make a decision. Amazing what you

Re: [nyphp-talk] Trying to decide between MDB2 and PHP PDO

2009-06-25 Thread Patrick May
Mainly b/c of it's variety of supported query types. it's quite nice. Notice the seamless and consistent parameter escaping as well. ~ p -- include('/path/to/adodb.inc.php'); $DB = NewADOConnection('mysql'); $DB->Connect($server, $user, $pwd, $db); # M'soft style data retrieval with binds $rs

Re: [nyphp-talk] Trying to decide between MDB2 and PHP PDO

2009-06-25 Thread Patrick May
i'd recommend adodb as your php db interface library: http://adodb.sourceforge.net/ On Thu, Jun 25, 2009 at 5:28 PM, Eugene Jen wrote: > >From the result of your benchmark, I think I need to trace the PDO, MDB > source. > It is very possible PDO and MDB doesn't do MySQL server side prepared >

Re: [nyphp-talk] "mysqli_real_escape_string" = clueless

2009-06-25 Thread Allen Shaw
a.k.a. prepared statements? Okay, got it. Thanks much for the clue. Got some reading to do now... - A. Eddie Drapkin wrote: parameterized queries! On Thu, Jun 25, 2009 at 6:39 PM, Allen Shaw wrote: John Campbell wrote: if I ever see "mysqli_real_escape_string" in someone's code, I

Re: [nyphp-talk] "mysqli_real_escape_string" = clueless (was: Trying to decide between MDB2 and PHP PDO)

2009-06-25 Thread Eddie Drapkin
parameterized queries! On Thu, Jun 25, 2009 at 6:39 PM, Allen Shaw wrote: > John Campbell wrote: >> >> if I ever see "mysqli_real_escape_string" in someone's code, I immediately >> write the >> person off as clueless. >> > > Clearly you're working a few levels above where I am, which is not saying

[nyphp-talk] "mysqli_real_escape_string" = clueless (was: Trying to decide between MDB2 and PHP PDO)

2009-06-25 Thread Allen Shaw
John Campbell wrote: if I ever see "mysqli_real_escape_string" in someone's code, I immediately write the person off as clueless. Clearly you're working a few levels above where I am, which is not saying much, to be fair. What techniques are we talking about here that make this function ob

Re: [nyphp-talk] Trying to decide between MDB2 and PHP PDO

2009-06-25 Thread John Campbell
On Thu, Jun 25, 2009 at 5:44 PM, Eddie Drapkin wrote: > Wait, are you advocating //against// prepared statements? Not at all, but when using mysql, you should emulate them. I am actually all for "prepared" style queries, if I ever see "mysqli_real_escape_string" in someone's code, I immediately w

Re: [nyphp-talk] Trying to decide between MDB2 and PHP PDO

2009-06-25 Thread Eric Gewirtz
Hi, I work with Kevin. Our application needs to run on both mySQL and Oracle so we are looking for portability. We currently are using PEAR DB and we are looking into moving to MDB2 or PDO so we thought it would be a good idea to test performance before we make a decision. Amazing what you find whe

Re: [nyphp-talk] Trying to decide between MDB2 and PHP PDO

2009-06-25 Thread Eddie Drapkin
On Thu, Jun 25, 2009 at 5:38 PM, John Campbell wrote: >> I was told that using a prepare is much faster then using raw sql but my >> test results prove otherwise. Why is the prepare and execute method is >> slower than building the statement manually and querying the server? > > The "prepare is fas

Re: [nyphp-talk] Trying to decide between MDB2 and PHP PDO

2009-06-25 Thread John Campbell
> I was told that using a prepare is much faster then using raw sql but my > test results prove otherwise. Why is the prepare and execute method is > slower than building the statement manually and querying the server? The "prepare is faster" lie was started as a conspiracy to trick the idiots int

Re: [nyphp-talk] Trying to decide between MDB2 and PHP PDO

2009-06-25 Thread Eugene Jen
From the result of your benchmark, I think I need to trace the PDO, MDB source. It is very possible PDO and MDB doesn't do MySQL server side prepared statement, which will increased the performance. PDO and MDB may just emulate JDBC doing fake client side prepared statement, which will not incr

[nyphp-talk] Trying to decide between MDB2 and PHP PDO

2009-06-25 Thread Kevin Castiglia
Hello all, I am trying to decide whether to use MDB2 or PHP PDO. I am sort of leaning towards using PHP PDO at the moment, but I'd rather ask some experts on their opinion. Just fyi, I am using PHP 5.2.6-1+lenny3 and mySQL on a Linux server, I have created a table of about 20 fields and loaded 20,