Hello,
I noticed in an error log that the users login date and username fields were being reported as failing to be updated in the database. For example, taken directly from the log file itself:
===================
16:32:50 - 29/07/2015 MINOR<Br>Failed to update users login time<Br>Failed to update users login time</p>*<p>16:32:50 - 29/07/2015 MINOR<Br>Failed to update users username
===================
I started a mariadb general log and could see the commands being executed ('update's basically). I then ran the update manually and got the response:
===================
MariaDB> UPDATE logindetails SET firstname = ...
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0
===================
Looking in database_library.php shows that for delete and update commands it returns the number of rows (line 147): return $statement->rowCount(); /* number of rows affected */
However, in user_library.php it says (lines 228 and 241) :
=================
if(db_query($query, $params)){
=================
So if zero rows are affected, which is correct if the data hasn't changed, then this is treated as false/failed. The comparison should be against PHP 'false'. I changed both lines to say:
=================
if(db_query($query, $params) !== false){
=================
and the update failures have now stopped.
John.