How to get data from database in javascript based on the value passed to the function

前端 未结 3 1003
不知归路
不知归路 2020-12-10 00:00

In my web application, I want to retrieve data from database based on the value that is passed to the function. I wrote the query as follows.



        
3条回答
  •  甜味超标
    2020-12-10 00:39

    'SELECT * FROM Employ where number = ' + parseInt(val, 10) + ';'
    

    For example, if val is "10" then this will end up building the string:

    "SELECT * FROM Employ where number = 10;"
    

提交回复
热议问题