PDA

View Full Version : Connecting to a database



hosdank
08-03-2008, 01:21 AM
I was just wonder if anyone could give me help with how to connect to a MySQL database in JavaScript. Thanks :)

Nile
08-03-2008, 02:18 AM
There's no way unless you used ajax. But it would still need a serverside. Check out ajax:
http://www.w3schools.com/Ajax/Default.Asp

mburt
08-03-2008, 03:48 AM
Why would you want to connect to a database with JavaScript? Even if you did get it to work with Ajax, think about how insecure it is? Server-side languages execute behind the HTML output, however JavaScript does not - hence the term client-side.

So any database information would be in your HTML source.

hosdank
08-03-2008, 05:54 PM
Thanks :)