1

I'm building a CRUD application using DataTables API and trying to set up Editor. After some help from the DataTables Team, I was able to get partially through the setup process, but Editor is not pulling any records from my database into DataTables. They mentioned that I needed to update the config.php file which contains the information needed to connect to the database. When I updated it, I see this:

Fatal error: Uncaught Error: Call to a member function transaction() on string in C:\xampp\htdocs\ccrp\api\lib\Editor.php:964 Stack trace: #0 C:\xampp\htdocs\ccrp\api\lib\Editor.php(700): DataTables\Editor->_process(Array) #1 C:\xampp\htdocs\ccrp\api\server_data.php(53): DataTables\Editor->process(Array) #2 {main} thrown in C:\xampp\htdocs\ccrp\api\lib\Editor.php on line 964

I am not sure what this error means or how to fix it. The DataTables team says it may have something to do with the config.php file I updated, so here is my current config file:

<?php if (!defined('DATATABLES')) exit(); // Ensure being used in DataTables env.

/*
 * DB connection script for Editor
 * Created by http://editor.datatables.net/generator
 */

// Enable error reporting for debugging (remove for production)
error_reporting(E_ALL);
ini_set('display_errors', '1');

/*
 * Edit the following with your database connection options
 */
$sql_details = array(
    "type" => "Mysql",
    "user" => "root",
    "pass" => "",
    "host" => "localhost",
    "port" => "",
    "db"   => "ccrp_db",
    "dsn"  => "charset=utf8"
);

?>
Jeremy Myrtle
  • 97
  • 2
  • 13

1 Answers1

0

I solved it. For others who also struggle with this, make sure you include the $db variable that is in the instance constructor generated from Editor.

Jeremy Myrtle
  • 97
  • 2
  • 13