$id = R::store(R::dispense(['_type'=>'book','title'=>'BeanStory']));
$id2 = R::store(R::dispense(['_type'=>'book','title'=>'a Story about a Bean']));
var_dump(R::exec('UPDATE book SET title = ? WHERE id = ? OR id = ?',['BeanStories',$id,$id2]));
var_dump(R::exec('UPDATE book SET title = ? WHERE id = ?',['BeanStories',$id]));
var_dump(R::exec('UPDATE book SET title = ? WHERE id = -1',['BeanStories']));
var_dump(R::exec('UPDATE book SET title = ? WHERE nonexistant_column = -1',['BeanStories']));
SQLite will return
int(2) -- two books updated
int(1) -- one book updated (not really but depends on DB, SQLite says updated 1 although title is same)
int(0) -- no books have been updated
PHP Fatal error: Uncaught [HY000] - SQLSTATE[HY000]: General error: 1 no such column: nonexistant_column -- Exception (in frozen mode)
MySQL will return
int(2) -- same
int(0) -- see? MySQL sees it differently
int(0) -- no books, same
PHP Fatal error: Uncaught [42S22] - SQLSTATE[42S22]: Column not found: 1054 Unknown column 'nonexistant_column' in 'where clause'
cheers
Gabor