Hello all!
I was wondering if it would be possible to query a MySQL database using jQuery (or even standard Javascript). I am currently achieving this goal by using a XMLHttpRequest, and some PHP code.
function getCount() {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readystate == 4 && xmlhttp.status == 200) {
alert(xmlhttp.responseText);
return xmlhttp.responseText;
} else {
alert(xmlhttp.responseText);
return xmlhttp.responseText;
}
}
xmlhttp.open("GET", "scripts/php/get.php?v=myval", true);
xmlhttp.send();
}
This works fine, but, my goal is to stop relying on PHP so much (don't get me wrong, I love PHP, I spend hours on end developing things with it everyday).
What I want to be able to do, is query my data, and store it as an array in Javascript, and then be able to work with the data using jQuery... If I still have to use PHP, that's fine, but I would prefer not having to use any
echo calls.
Any help is appreciated,
Gigabyte Giant