How can I make that if sql query is empty then it does this alert on top of the browser. I tried installing "alert" and it worked but I cant change its UI. I have this funcion on html but I don't know how to call it from my server side script.
function myFunction() {
alert("Hello! I am an alert box!");
}
This is my server side code right now
connection.query(SQL QUERY) {
if(err) throw err
if (rows.length <= 0) {
alert("This is not what i need")
}
You can't call alert server-side, because the server does not have a window object.
You should send a message to the client and then call the alert function there.
And besides that, you can't change the UI of the alert dialog box because it's defined by the browser.