-
Bug
-
Resolution: Fixed
-
Major
-
3.1.0-b4
-
None
-
None
$sql = 'UPDATE ' . $this->fields_data_table . '
|
SET ' . $this->db->sql_build_array('UPDATE', $cp_data) . '
|
WHERE user_id = ' . (int) $user_id;
|
$this->db->sql_query($sql);
|
|
if (!$this->db->sql_affectedrows())
|
{
|
$cp_data = $this->build_insert_sql_array($cp_data);
|
$cp_data['user_id'] = (int) $user_id;
|
|
$this->db->sql_return_on_error(true);
|
|
$sql = 'INSERT INTO ' . $this->fields_data_table . ' ' . $this->db->sql_build_array('INSERT', $cp_data);
|
$this->db->sql_query($sql);
|
|
$this->db->sql_return_on_error(false);
|
}
|
The "return on error" was added before we had PHPBB3-12570 to prevent errors when adding rows a second time.
Since sql_affectedrows() works correctly now, the sql_return_on_error() calls should be removed.
- is related to
-
PHPBB-12570 db_text throws an error, when set() is called with the current value
- Closed