如何在使用php / jquery执行查询后显示响应

Hello i managed to execute my query using php/pdo and with the help of jQuery and everything going fine expect i don't know how to show response when the query is executing.

form code

<form id="example" method="post" action="">
    <input type="text" name="amount" /><br>
    <input type="text" name="description" /><br>
    <input type="password" name="password" /><br>
    <input type="submit" value="Add" onClick="$.post('add.php', $('form#example').serialize())">
</form>

add.php

$amount         = $_POST['amount'];
$description    = $_POST['description'];
$password       = $_POST['password'];

$q = $db->prepare("INSERT INTO money (amount, description, password) VALUES (:amount, :description, :password)");
$q->execute(array(':amount' => $amount, ':description' => $description, ':password' => $password));

The query going fine i want to know how can i show a success message on the main page thanks in advance.

Use the success callback function from the post method and output whatevery message you like.

<input type="submit" value="Add"
   onClick="$.post('add.php', $('form#example').serialize(), function() { $(body).append($('<div />').text('success'); })">