usmanhalalit / pixie

Database query builder for PHP, framework agnostic, lightweight and expressive.
MIT License
672 stars 180 forks source link

How you check if your last query (i.e. update) was successful? #164

Closed dragonattack closed 7 years ago

dragonattack commented 7 years ago

I could imagine it should be:

$res = db::table('articles')->where('id', 1)->update($update);

But it's not. How you do that? Thanks.

eL-Prova commented 7 years ago

What is your result right now?

dragonattack commented 7 years ago
PDOStatement::__set_state(array(
   'queryString' => 'UPDATE `articles` SET `title`=? WHERE `id` = ?',
))
TCB13 commented 7 years ago

At lest in my case it is raising exceptions if and insert / update goes wrong... just try/catch that. Example, I've messed up an insert here and as you can see a \PDOException is raised: captura de ecra 2017-06-29 as 10 56 18

Update works in the same way.

TCB13 commented 7 years ago

@dragonattack so?