Solved

sqlite on php

Posted on 2014-01-09
4
314 Views
Last Modified: 2014-01-14
what do I need to install in order to have sqlite on php

how can I import a .sql dump file for create and insert

and how do I run this file?
Am I required to have a sqlite query editor installed and do I need to select an open port?
0
Comment
Question by:rgb192
4 Comments
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 166 total points
Comment Utility
SQLite is either built-in (PHP5.0 to 5.3) or installed from PECL (PHP5.4+).  The SQLite server is the extension that is part of PHP.  I don't know of a 'query editor' for it though there might be.  For a demo, I created the database and tables thru PHP.  No port is needed because the database is accessed thru files and not thru the network.

PHP - http://us2.php.net/manual/en/book.sqlite.php
SQLite - http://sqlite.org/
0
 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 167 total points
Comment Utility
Please see the answer here:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28331641.html#a39761872

What have you tried in the way of imports?  There may be minor implementation differences, but SQL is SQL and most of the commands should work.
0
 
LVL 33

Accepted Solution

by:
Slick812 earned 167 total points
Comment Utility
greetings rgb192, do you definitely know that SQLite is NOT available to you in your PHP version? ? Almost ALL PHP installs have SQLite of one version or the other.  Please understand that SQLite is a very different "Data Base Engine" than the MySQL that you are used to. In SQLite you do not connect to a database server, it just "Reads a File" in your directoies to open the Database.

Run this code to see if you have SQLite available -
<?php
error_reporting(E_ALL); 
ini_set("display_errors",1);

if ($dbo = new SQLite3('studys.slite')) {
   echo 'YES, SQLite3 works ! !';
   } else echo 'ERROR, Did NOT open studys.slite file to create Database';
?>

Open in new window

if you do not have SQLite3 then you will see a PHP Fatal ERROR, You may have SQLite2 installed insted? Other code is need for that.

Also, related to your previous question about PDO, , the PDO SQLite is NOT the same as the PHP SQLite, as far as installation. I have used servers where PDO had SQLite3, but the PHP only had SQLite2 installed, you can have   PDO  with SQLite, and PHP without SQLite, or the other way.
0
 

Author Closing Comment

by:rgb192
Comment Utility
From another question, I now know it is just a php.ini change. Best answer for me is the php to test availability of sqlite.

Thanks all.
0

Featured Post

Easy Project Management (No User Manual Required)

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now