unknown1 Posted September 7, 2009 Share Posted September 7, 2009 Maybe a stupid question but is it possible to use javascript to query a mysql database?/ if so can someone explain how... Thanks!! Quote Link to comment Share on other sites More sharing options...
haku Posted September 7, 2009 Share Posted September 7, 2009 You can't - directly. You need to use AJAX (or more specifically an HTTPRequestObject) to do a behind the scenes request to a script on the server. You use this script (which can be any server-side language) to perform the query on the database, then send it back to your ajax request with the returned data. You then use javascript to parse the returned data and do whatever you want with it. So basically it's a four step process: 1) Javascript -> server-side script 2) Server-side script -> database 3) Database -> server-side script 4) Server-side script -> javascript Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.