How to run mysql query generated in javascript?

  • Goal: hi. i want to run mysql query generated in javascript.

  • Steps:
    I did like below. but it doesn't work.

query1. Make query in javascript
image

query2. use {{}} to call query string from query1

thanks

please don't care about additional scope 'sql' bellow SQL Statement. it doesn't work even though remove it. thanks

Hey @itmightbecool,

This is because of prepared statements. You can read the documentation here.

thanks @MiguelOrtiz
But I just want to know how run the query generated from JS. For example the query looks like "select * from table_name". Not parameter (no table name, no where condition.. etc)

HI @itmightbecool,

Also, welcome to the forum!

I don't know why you want to generate it from the JS query, why not write it directly in your SQL query?

As I said in my previous post, you won't be able to write a SQL query in JS and then use it in the SQL query, you need to write your select and from statements completely in the sql query

@MiguelOrtiz
oh.. i got it.. I understood that in js, I only can create prepared statements and not create queries themselves.