471,624 Members | 1,704 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,624 software developers and data experts.

FIXED: PEAR::prepare problem with transactions

HI,

I spent all this afternoon to solve this problem, so I thought to write
two lines to describe this strange behaviour.....

- I'm using PHP with PEAR:DB package.
- I set autocommit to false
- I prepare a statement
- I execute it
- THE PAGE NEVER COMPLETES

SOLUTION:

- Use the 'query' method intead of the 'prepare' method. Pass the
'query' method the prepared arguments.

$res =& $DB->query('INSERT INTO person (id,username)VALUES (?, ?)',
array(1, 'Dario'));
HOPE THIS HELPS!!
Dario

Jul 17 '05 #1
0 1084

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by me | last post: by
1 post views Thread by Joe Randstein | last post: by
reply views Thread by Joe | last post: by
1 post views Thread by SJ | last post: by
2 posts views Thread by Brian Henry | last post: by
2 posts views Thread by Eric Lindsay | last post: by
reply views Thread by mmr315 | last post: by
1 post views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.