Rainoa
Rainoa

Reputation: 501

Quick and dirty connection to a database with javascript

I am trying to connect to a database using JavaScript. I have read that it is not recommended to use Client-side to connect to the database, for multiple reasons. But right now I am just trying to make a working local version.

What are some suggestions for getting a working local version? Am I able to get it done with purely JavaScript even tho it is bad practice? Or do I need assistance by php/ajax to make it work?

I have no experience with PHP.

Upvotes: 1

Views: 134

Answers (1)

kscherrer
kscherrer

Reputation: 5766

i thought it's impossible until i just saw this post.

but even if it is possible, don't do it! with this solution, every user can see the database connection parameters like username and pwd and therefore mess with your DB.

Instead, learn how to access a DB using PHP and use that in your local environment already. Its really not that complicated, you can find many instructions and tutorials if you're looking around

Upvotes: 1

Related Questions