Solved

sqlite on php

Posted on 2014-01-09
4
323 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 166 total points
ID: 39769362
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 110

Assisted Solution

by:Ray Paseur
Ray Paseur earned 167 total points
ID: 39769685
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 34

Accepted Solution

by:
Slick812 earned 167 total points
ID: 39771669
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
ID: 39780909
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

738 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