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.

dvicemuse
  • 370
  • 2
  • 10
  • 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](http://stackoverflow.com/questions/13734395/form-inside-of-load-not-posting-correctly/13734466#13734466) and upvote it if it is helpful to you. – cssyphus Jul 03 '13 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. – Kevin B Jul 03 '13 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 – dvicemuse Jul 05 '13 at 17:00

1 Answers1

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.

Community
  • 1
  • 1
Jonas Äppelgran
  • 2,617
  • 26
  • 30