insert error
insert error
I have an issue where I am using data tables as my database abstraction layer. I have an issue where if I pass an array to an insert method like this:
$userIDsToInsert = ['key1'=>value,'key2'=>value];
$db()->insert( "table", $userIDsToInsert );
I get this error that says: Uncaught Error: Function name must be a string in /home/judf73/public_html/nessapp/includes/php/cronjobs/processGifts.php:76 where line 76 is the above insert. All other data tables queries work as expected. For completion, I will show you the complete file.
<?php
require __DIR__.'../../../../vendor/autoload.php';
include( "../../../Editor-PHP-1.6.2/php/DataTables.php" );
include("../../functions.inc.php");
use
DataTables\Editor,
// DataTables\Editor\Field,
// DataTables\Editor\Format,
// DataTables\Editor\Mjoin,
// DataTables\Editor\Options,
// DataTables\Editor\Upload,
// DataTables\Editor\Validate,
Underscore\Underscore as _;
$k = $db->raw()->exec( "SELECT * from table")->fetchAll();
$userIDsToInsert = ['key1'=>value,'key2'=>value];
$db()->insert( "table", $userIDsToInsert );
This question has an accepted answers - jump to answer
Answers
Should just be:
Allan
Oh boy, I can't believe I missed that one. Thank you.