If possible, how can I get (and post) data from a mysql database using javascript? I know I can use php and other languages, but I just need to know if this is possible with javascript?
Thanks in advance.
That's not possible with Javascript. I could not find this with server-side javascript too.
Not sure about your exact requirement, but you can use Ajax to interact with database though some server side language.
it is not possible, javascript is executed on the client.
you could make the javascript call something on the server (e.g. php script) that access the database though.
If by Javascript you mean NodeJS on the server, this project might interest you http://github.com/sidorares/nodejs-mysql-native - however the answers above are correct if you are talking about Javascript running inside a browser or other container.
If you want to run a vanilla javascript (for the concurrency speed) inside your own engine, I recommend looking at NodeJS and then using the NodeJS MySQL Native Driver that I linked above.
Judging from the "iPhone" and "Android" tags, I guess, you are trying to access the local storage databases on these platforms.
The Web SQL database API isn’t actually part of the HTML5 specification, but it is part of the suite of specifications that allows us developers to build fully fledged web applications, so it’s about time we dig in and check it out. Some examples are here
Do remove the tags iphone and android from this question. the tags are not relevant.
And only with javascript you cant accompolish this task , GET and POST request can be handled only by server side scripting languages like php.
Refer : http://www.javascriptkit.com/dhtmltutors/ajaxgetpost.shtml
javascript can get database from server if use AJAX , only a way is AJAX