Ajax[
^] is your friend!
No matter what, you will have to handle the database interactions in the server side, i.e. using PHP.
You will have to invoke the database operation using a Javascript HTTP request, and make the PHP code in server do the real operation in the database. After that, send the result back to the client as the normal HTTP response. And then you can display a nice little message box to the user using Javascript.
But, forget everything and read that tutorial I gave you, (if you don't know about Ajax, of course). And you'll find a way doing it then.