I searched all over net for an hour i couldn't find a decent code for updating database using javascript. Can anyone just give me a reference please??
3 Answers
You can do that with Node.js
Here's a sample blog post from interwebz that shows how to do it:
1 Comment
You need some kind of ServerSide Scripting (php, perl, cgi, java, etc.) Take a look on this: JavaScript to update MySQL?
Comments
JavaScript on itself cannot query any DB for you, as it can work effectively only on the browser. To work with DB you can use use PHP , and use ajax to communicate using $.ajax or $.post methods. A simple search on this will get you references. In short you can use ajax to communicate with PHP script which will in turn query the DB for you.
To start you can take a look at this, http://webcheatsheet.com/php/connect_mysql_database.php
Main thing to remember is Javascript will only affect your browser. I hope this helps.
Regards