I am pulling in values from MySQL into a php page like so:
$query = 'SELECT cinfo.`client_id`, cinfo.`client_first_name`, cinfo.`client_last_name` ';
$query.= 'FROM `client_information` AS cinfo ';
$query.= 'ORDER BY cinfo.`client_id` ';
These are being displayed within a table that has a loop for each row:
$result = mysql_unbuffered_query( $query );
echo "<table border='1'>";
echo "<tr>";
echo "<th>Client ID</th>";
echo "<th>Client First Name</th>";
echo "<th>Client Last Name</th>";
echo "</tr>";
while ($row = mysql_fetch_assoc($result))
{
echo "<tr>";
echo "<td>" . $row['client_id'] . "</td>";
echo "<td>" . $row['client_first_name'] . "</td>";
echo "<td>" . $row['client_last_name'] . "</td>";
echo "</tr>";
}
echo "</table>";
I have also set up an update/delete script in a separate file, assuming that on 'update' or 'delete' variables storing the info will be passed to that file and run an update to the client's information based on the ID.
My lack of knowledge is the asynchronous aspect of submission, and I am having trouble incorporating javascript/jquery into the results to edit and update the values stored within the database without a page refresh. Does anyone have an idea on how to best accomplish this?
Essentially I'd like the page to act as shown below:
Info as pulled from MySQL:
After the user clicks "Edit":
Information after update: