Jump to content

How to access the SQLite database using AJAX in ubuntu?


Newbie89

Recommended Posts

have you read through the AJAX tutorials at all? Or anything on SQLite? It sounds like you haven't. I would start there. http://www.w3schools...jax/default.asphttp://php.net/manua...book.sqlite.php The only thing that sqllite will change in the entire flow is just what functions you call in PHP. Everything else will be the same as any other normal AJAX request. Honestly, from the sounds of it, I would just play around with the SQLite code you need in a normal PHP file frist till you can get the output you want. After that, then I would integrate AJAX into the mix.

Edited by thescientist
Link to comment
Share on other sites

<!DOCTYPE html><html><head><script>function loadXMLDoc(){var xmlhttp;if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("myDiv").innerHTML=xmlhttp.responseText; } }xmlhttp.open("GET","ajax_info.txt",true);xmlhttp.send();}</script></head><body> <div id="myDiv"><h2>Let AJAX change this text</h2></div><button type="button" onclick="loadXMLDoc()">Change Content</button> </body></html>

Link to comment
Share on other sites

put the txt file in the same directory as the html file. You should look up how to find the error console for your browser so you can look for errors as you test your code.

Link to comment
Share on other sites

show us the latest code you are using. please indent, format, and use [ code [/ code ] (no spaces) tags when posting. also include the contents of the .txt file.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...