0

After reading a ton of other questions on the subject I feel as though I should preface this question with: This is not about phonegap or android development

A quick recap on how I have come to this headache.

  • wrote a bash script to recursively read the contents of a dvd and write them to a .txt
  • used this script to catalog about fifty thousand files (extensions, creation date etc.)
  • used php/wamp server to parse the data and create a sqlite database
  • followed a tutorial here to figure out how to (try to) read that database with jquery

using var db = openDatabase("catalog.db"); I expected jquery to be able to load this database since the js and the and the database are in the same directory.

it seems as though this function is meant for "Browser embedded" databases and not local databses.

How do I read a sqlite database file and not the browser's database?

Looking for a solution where multiple users are able to see the same response from an offline database. Distribution should be as simple as reading a folder from a flash drive without installing anything.

About to give up on this and just make it a cloud solution instead of an offline solution.

3
  • jQuery (or javascript) won't read your database, but PHP will. However, jQuery can AJAX a request to a PHP file, then the PHP file does the desired lookup and ECHOs out a result, and the jQuery will receive that response in the AJAX routine's success: function. See this example and upvote it if it is helpful to you. Commented Jul 3, 2013 at 18:41
  • @gibberish isn't the database he's trying to access on the client that is theoretically offline? how would php help? Basically the question here is is it possible to access a local database from the browser. This will most likely depend on the browser, if any of them allow it at all. Commented Jul 3, 2013 at 18:53
  • @Kevin B you are correct. I am trying to create a completely self reliant offline database that can be read without server languages like php. I have done ajax requests before, however I am looking for something that could operate off of a flash drive without an internet connection. Thanks for the help guys but it would seem as though I may be trying to achieve the imposible Commented Jul 5, 2013 at 17:00

1 Answer 1

1

You can't read a sqlite database with javascript. The question What's the simplest way to import an SQLite SQL file into a WEB SQL Database has some answers on importing the database to the browsers database.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.