I am not sure if a line of PHP could be run inside of a JavaScript function. For example:
No - the query will be ran once on the server, and the JavaScript will call an empty function.
Note, you should be using just message there, otherwise JavaScript's eval() is being called internally.
message
eval()