total rows updated by sql query
total rows updated by sql query
Considering standalone editor with keyless data. If I want to use something like
$db
->query( 'update' )
->table( 'table_name' )
->set( 'test', $_POST['data']['keyless']['test'] )
->where( 'id', 1, '=' )
->exec();
How do I get the outcome of this query i.e. (Result) e.g. number of rows effected
I spent a lot of time looking for examples and reading the documentation without any luck.
This discussion has been closed.
Answers
Normally you would use the fact that
$db->exec()
returns aResult
object.But that doesn't include the effected rows. For that I think you'd need the PDO object:
Allan
thanks for replying.
nothing worked for my specific need. So, I ended up returning error on error or empty data on both (successful update and nothing updated)