insertBulk inserts rows of data, so I assume you mean rows rather than columns... In case you did mean columns then you should be using the schema manager for that which has a dropColumns method.$db->query('
DELETE FROM table
WHERE column = ?
', 'something');
$db->delete('table', 'column = ?', 'something');
insertBulkinserts rows of data, so I assume you mean rows rather than columns... In case you did mean columns then you should be using the schema manager for that which has adropColumnsmethod.
But aside from that, there doesn't need to be a bulk method for deleting rows from a table, because the deletes work like a select query in that you just give the relevant conditions/limits and based on that it will delete as many rows as it matches.
So you'd be looking at either:
Or:PHP:$db->query(' DELETE FROM table WHERE column = ? ', 'something');
PHP:$db->delete('table', 'column = ?', 'something');
XF\Db\InvalidQueryException: MySQL statement prepare error [1064]: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'column = field_id' at line 1 in src\XF\Db\AbstractStatement.php at line 217
XF\Db\AbstractStatement->getException() in src\XF\Db\Mysqli\Statement.php at line 196
XF\Db\Mysqli\Statement->getException() in src\XF\Db\Mysqli\Statement.php at line 39
XF\Db\Mysqli\Statement->prepare() in src\XF\Db\Mysqli\Statement.php at line 54
XF\Db\Mysqli\Statement->execute() in src\XF\Db\AbstractAdapter.php at line 89
XF\Db\AbstractAdapter->query() in src\XF\Db\AbstractAdapter.php at line 243
XF\Db\AbstractAdapter->delete() in src\addons\AH\GamerProfiles\Setup.php at line 114
AH\GamerProfiles\Setup->uninstall() in src\XF\Admin\Controller\AddOn.php at line 635
XF\Admin\Controller\AddOn->actionUninstall() in src\XF\Mvc\Dispatcher.php at line 321
XF\Mvc\Dispatcher->dispatchClass() in src\XF\Mvc\Dispatcher.php at line 248
XF\Mvc\Dispatcher->dispatchFromMatch() in src\XF\Mvc\Dispatcher.php at line 100
XF\Mvc\Dispatcher->dispatchLoop() in src\XF\Mvc\Dispatcher.php at line 50
XF\Mvc\Dispatcher->run() in src\XF\App.php at line 2155
XF\App->run() in src\XF.php at line 389
XF::runApp() in admin.php at line 13
$this->db()->delete('xf_user_field','column = field_id', 'ah_playstation');
It must befield_id = ?notcolumn = field_idif you want to delete rows where field_id has a certain value.
We use essential cookies to make this site work, and optional cookies to enhance your experience.