Datatables Generator - Database type SQLite

Datatables Generator - Database type SQLite

mccloudmccloud Posts: 35Questions: 15Answers: 2

Any plans of including SQLite as an database type option in the online Generator, anytime soon?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,453Questions: 1Answers: 10,055 Site admin

    No plans at the moment, but if there is enough demand for it I can look in to it :).

    Allan

  • mccloudmccloud Posts: 35Questions: 15Answers: 2

    My problem seems to be how to fill out the config.php and sql files which are created by the generator. I have played around with a test sqlite base called contacts.db which resides in the same folder as the initial contacts.html file.

    table.contacts.sql

    -- Editor SQL for DB table contacts
    -- Created by http://editor.datatables.net/generator
    -- 
    
    CREATE TABLE contacts (
     contact_id integer PRIMARY KEY,
     firstname text NOT NULL,
     lastname text NOT NULL,
     email text NOT NULL UNIQUE,
     phone text NOT NULL UNIQUE
    ); 
    

    and config.php

    <?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" => "Sqlite",
        "user" => "",
        "pass" => "",
        "host" => "localhost",
        "port" => "",
        "db"   => "contact.db",
        "dsn"  => "charset=utf8"
    );
    

    but it's still not showing the add, edit and delete functions.

    Any suggestions appreciated.

  • allanallan Posts: 61,453Questions: 1Answers: 10,055 Site admin

    What does it show? Can you use the debugger on the page? Any errors shown on the console?

    Allan

  • mccloudmccloud Posts: 35Questions: 15Answers: 2
    edited September 2017

    Thanks Allan. It is not connecting to the database. Only showing this:

    I think the problem is in the config.php file. I have put some dummy data in the db to test it.

  • allanallan Posts: 61,453Questions: 1Answers: 10,055 Site admin
    Answer ✓

    What is the data that is being returned from the server to the Ajax request that Editor is making? Or are there any errors shown on the console? That would be the first place to start.

    Allan

This discussion has been closed.