Hello, do we have a possibility to use db_affected_rows? Wiki says following are supported:
1 db_fetch_array
2 db_fetch_object
3 db_fetch_row
4 db_field_names
5 db_num_columns
I want to count how many rows have been affected after UPDATE query has been run.
If not implemented yet, can we get it?
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
PDO db_affected_rows Topic is solved
Re: PDO db_affected_rows
EDIT
worked around it :
worked around it :
Code: Select all
nuRunQuery($sql);
$affected_rows = nuRunQuery("SELECT ROW_COUNT()")->fetchColumn();
if ($affected_rows > 0) {
$js = "nuMessage('Good!', 2000,closePopup);
function closePopup() {
nuClosePopup();
}
";
} elseif ($affected_rows === 0) {
$js = "nuMessage('BAD');";
} else {
nuDisplayError('WRONG!!!');
return;
}
nuJavaScriptCallback($js);