Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8471893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:55:13+00:00 2026-06-10T16:55:13+00:00

I am creating tables in a SQLite database from a database dump made by

  • 0

I am creating tables in a SQLite database from a database dump made by Navicat.

Of the 3 CREATE TABLE queries I’m running, 2 fail, 1 works – so it’s not a permission / connection / config issue.

Here is the SQL:

CREATE TABLE "servers" (
"id"  INTEGER NOT NULL,
"name"  TEXT(32) NOT NULL,
"type"  INTEGER NOT NULL,
"host"  TEXT(128) NOT NULL,
"port"  INTEGER NOT NULL,
"rcon_port"  INTEGER NOT NULL,
PRIMARY KEY ("id")
);

CREATE TABLE "config" ("built"  INTEGER NOT NULL);

CREATE TABLE "users" (
"id"  INTEGER NOT NULL,
"username"  TEXT(32) NOT NULL,
"password"  TEXT(64) NOT NULL,
"salt"  TEXT(8) NOT NULL,
"last_login"  INTEGER NOT NULL,
PRIMARY KEY ("id")
);

Trying to run this – only the config table is created.

I can execute this script with Navicat and the tables are created – is there something syntactically wrong about this?

Also no errors / exceptions are being thrown

The PHP:

$path and $sql are confirmed to be correct

$db_conn = 'sqlite:' . $path;

try {
    $dbh = new PDO($db_conn);
    $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

    $dbh->query(file_get_contents($sql);
} catch (Exception $e) {
    var_dump($e);
    exit;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T16:55:15+00:00Added an answer on June 10, 2026 at 4:55 pm

    Try separating the file into individual queries and running those:

    $db_conn = 'sqlite:' . $path;
    $queries = file_get_contents($sql);
    
    try {
        $dbh = new PDO($db_conn);
        $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        $queries = explode(";", $queries);
        foreach ($queries as $query) {
            $dbh->query($query);
        }
    } catch (Exception $e) {
        var_dump($e);
        exit;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a SQLite database. To get data from the table I am
I'm creating a caching system to take data from an SQLite database table using
I am creating database at runtime and I want to create the tables in
I am creating an iOS app that reads data from a single SQLITE table
I am retrieving rows from SQLite table, then dynamically creating an object, and then
I would like to create a table in a SQLite database using the Server
I am creating a SQLite database for my iPhone projects. I have table called
In my application I am creating many tables in the sqlite database but in
I just started to upload CSV files and creating tables in the database of
When creating database tables I'm often stumped when trying to name my time/date/timestamp fields.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.