dbUpdate will return 0 if no data is changed

This commit is contained in:
laf
2016-05-26 21:03:24 +00:00
parent da2788e074
commit 582ad082aa

View File

@@ -37,7 +37,7 @@ else {
$widget_settings = array();
}
if (dbFetchCell('select 1 from users_widgets inner join dashboards on users_widgets.dashboard_id = dashboards.dashboard_id where user_widget_id = ? && (users_widgets.user_id = ? || dashboards.access = 2)',array($widget_id,$_SESSION['user_id'])) == 1) {
if (dbUpdate(array('settings'=>json_encode($widget_settings)),'users_widgets','user_widget_id=?',array($widget_id))) {
if (dbUpdate(array('settings'=>json_encode($widget_settings)),'users_widgets','user_widget_id=?',array($widget_id)) >= 0) {
$status = 'ok';
$message = 'Updated';
}