homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Database Connection in JavaScript
connecting to mysql with javascript

 6:28 pm on Jul 29, 2003 (gmt 0)

Hi everyone,

is there a way to use Javascript to connect to a MySQL database? If so, how? Thanks!



 6:36 pm on Jul 29, 2003 (gmt 0)

Not client side javascript. If you are using asp then you can use jscript, but you have to be running IIS. To connect to a database you must use a server-side technology.


 7:11 pm on Jul 29, 2003 (gmt 0)

Okay then,

let's say I want to call a PHP script on the server to connect to the database. But, I have some data that I took in JavaScript that I want to send to the DB. Is there a way to pass data between the two languages?


 9:20 pm on Jul 29, 2003 (gmt 0)

If the data you are trying to pass is in a form, then no problem, just set the form action to your php script, then submit the form.

If the data you are getting from your user is not in a <form> (not likely, but possible), then create a form, set action to url of php script, pass the javascript-acquired data to a hidden parameter <input type=hidden .....>, then trigger the submission of the fom with an event handler.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved