Warning: don't use the column name `created`. It has caused a MySQL error in Drupal 8.4.0:
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'create ...
Comments3
Thanks!
This is super cool and to-the-point; however, you've got a semi-colon after updateFields(); ... but then an ->expression() call.
For my needs I didn't need the ->expression so just removed it.
Thank you for the correction
Hi Chris, Thank you for the correction, If you want to add expression or any other method, you can also do like:
$query
->expression('count', 'count + :inc', array(':inc' => 1));
Warning
Warning: don't use the column name `created`. It has caused a MySQL error in Drupal 8.4.0:
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'create ...