I want to run a SQL query in a .JS file. I tried to add some PHP codes to it but it didn\'t work of course.
I want to run the SQL query: SELECT price FROM list WH
SELECT price FROM list WH
You cannot connect to Mysql directly from client side JS, but only from server side JS, such as node. It can just like PHP connect using PDO or mysqli extensions, run your query and then pass the information to client side JS.
node