FIXED: PEAR::prepare problem with transactions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ProgDario

    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('INSER T INTO person (id,username)VA LUES (?, ?)',
    array(1, 'Dario'));


    HOPE THIS HELPS!!


    Dario

Working...