| View previous topic :: View next topic |
| Author |
Message |
Jesdisciple
Joined: 24 Mar 2008 Posts: 11 Location: Texas
|
Posted: Wed Mar 26, 2008 8:14 am Post subject: MDB2: Anything else I should do with my connection? |
|
|
Currently I have this sequence working; should I add/change any thing? (I'm picking up bits and pieces of the Getting Started guide that no one has compiled yet.) | Code: | $driver =& MDB2::connect(/*...*/);
$driver->beginTransaction();
///...
$driver->query(/*...*/);// actually in a foreach
$driver->commit();
$driver->disconnect(false); |
Thanks! |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1011
|
|
| Back to top |
|
 |
Jesdisciple
Joined: 24 Mar 2008 Posts: 11 Location: Texas
|
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1011
|
Posted: Thu Mar 27, 2008 12:16 am Post subject: |
|
|
Sorry, I'm too lazy tonight to have a deeper look into your code. prepare() and execute() are interesting if you're using queries multiple times (i.e. same query but different values).
This feature might look a little bit weird at first, but once you've understood the concept, it's really nice and handy (of course, only if the usage makes sense; see above). |
|
| Back to top |
|
 |
Jesdisciple
Joined: 24 Mar 2008 Posts: 11 Location: Texas
|
Posted: Thu Mar 27, 2008 12:48 am Post subject: |
|
|
Woops, I thought you were suggesting that I should present the full source.
I was uncertain whether I should alter my code because I had a similar system established, except I used named placeholders exclusively and I prepared my statements once per query. (The purpose of the system was primarily to store my queries in XML, so I hadn't considered a prepare-execute setup.)
But I'm trying it; if I run into too much trouble I'll just go back in SVN.
Thanks! |
|
| Back to top |
|
 |
|