Reputation: 41
basically im trying to make the ubiquitous "like button," and update a MySQL table after its clicked without loading the page. I imagine this would use javascript, but I'm not sure how to access MySQL with javascript. Please answer for pure javascript only as I dont use JQuery. Thanks.
Upvotes: 0
Views: 755
Reputation:
To access a MySQL database from JavaScript, you'll need to implement a call to a server side script.
For tips on setting up the javascript without jQuery, you might check this guide (and the following pages): http://www.w3schools.com/ajax/ajax_xmlhttprequest_create.asp
Upvotes: 0
Reputation: 557
Ajax would be the perfect way. You access the "server page e.g. PHP/JSP/ASP" which in turn updates the MySQL table.
Upvotes: 0
Reputation: 3211
You have to use Ajax to accomplish this task.
Check this tutorial too.
Upvotes: 1