How can I connect an HTML5 web application to a sqlite database which is on server side?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
You need to use a server-side language such as php (or any other server-side language that has support for sqlite databases). A client-side application can’t access anything on the server other than information exposed as http services (a web page or json web service for example). Your html5 application can use ajax to make the http request to the server-side script which actually makes the sqlite database queries and returns the information to your application. Using a good client-side library like jquery can make the ajax calls quite easy:
The code above is just an example – it may not be exactly correct, but you should get the idea. I won’t put an example of what the server-side script would do to retrieve the data from sqlite and return it as JSON (or whatever data format you like) – they are easily found with a quick google/bing search.