php - Using PDO and transactions, but I dont get error so rollback wont work. -


I am trying to create a simple class in PHP,

   Try the query ($ nick); $ NickID = $ db- & gt; Last Interactive Id (); Resonance $ niched; Include in $ Pers = "` webshop` person (person id ',' user id ',' fnm ',' lanam ','person', 'email') value (zero, $ nickid, '$ _POST [ First name] ',' $ _POST [last name] ',' $ _POST [person's name] ',' $ _ POST [email] ') "; Include $ Addr = "` webshop`. 'Address' (`Edit ID',` user id`, `road`,` city`, `zip`) value (zero, $ nickid, '$ _POST [address]', '' $ _POST [city] ',' $ _POST [zip] ') "; $ Db- & gt; Query ("INSERT" `` wshop`` `` `` `(` Person ID ', `UserID`,` FNA`, `LANA`,` PersonNR`, `Email`) value (Zero, $ Nickid, '$ _POST [first name]', '$ _POST [last name]', '$ _POST [person's name]', '$ _ POST [email]') "); $ db- & gt; query ($ addr );} Catch (exception $ e) {echo 'cat exception:', $ e-> getMessage (), "& lt;  

Make sure that the PDO error mode is set to: PDO :: ERRMODE_EXCEPTION Otherwise, you will have to check the error status after each query.

Check for.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -