-1

I'm trying to build a basic website to display data from MySQL. Is there anyway to do this using just JavaScript and HTML? I feel like this is a simple task...but I'm still new to programming, so I'm having a hard time piecing everything together. Thanks in advance!

TLeeL8454
  • 1
  • 2
  • Is this still client/server side? – Sam Segers Dec 17 '15 at 00:49
  • You can not post data to the server just using javascript. You need also PHP in order to interact with server. – Franco Dec 17 '15 at 00:52
  • PHP is one language, not the only option on the server. But you do need something on the server. If you use Node.js, that could be Javascript. – Dan Lowe Dec 17 '15 at 01:28
  • Little disappointing you didn't google javascript connect to mysql. You would have found an answer. – Trevor Dec 17 '15 at 01:32
  • Possible duplicate of [Can JavaScript connect with MySQL?](http://stackoverflow.com/questions/3020751/can-javascript-connect-with-mysql) – Slacks. Dec 17 '15 at 02:56

1 Answers1

0

No, JavaScript can not directly connect to MySQL. But you can mix JS with PHP to do so.

JavaScript is a client-side language and your MySQL database is going to be running on a server (Source)

Also try searching for a post before duplicating it next time!

Community
  • 1
  • 1
Slacks.
  • 199
  • 1
  • 15