Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Database Connection in JavaScript

connecting to mysql with javascript



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

10+ Year Member

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)

WebmasterWorld Senior Member korkus2000 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

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)

10+ Year Member

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)

10+ Year Member

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.


Featured Threads

Hot Threads This Week

Hot Threads This Month