Using mysql query results for further process
Posted: Mon Oct 01, 2007 10:15 pm
hi all,
i am developing an online loan application and processing system.
there is a part in my project where i retrieve all loans that have been analyzed and allow user to either approve or reject it.i have no problem in retrieving the data from the database.
here is my code that retrieves the information.
so, what i want to do after this is, i want the user to be able to click on approve/reject, and the system will
automatically save the status into the database. im not sure what code to use, or even where to insert it in the loop..if it is possible,after the user clicks on approve/reject, i want that row of data to be deleted from the table.
any help will be greatly appreciated..thank you so much

i am developing an online loan application and processing system.
there is a part in my project where i retrieve all loans that have been analyzed and allow user to either approve or reject it.i have no problem in retrieving the data from the database.
here is my code that retrieves the information.
Code: Select all
$query = "SELECT loanID,custNric,loanAmt,score FROM loanDetails WHERE loanDetails.ad=1 ";
//ad is the variable that shows whether the loan has been analyzed or not
$result = mysql_query($query) or die(mysql_error());
echo "<table border='1'>";
echo "<tr> <th>Loan ID</th> <th>Loan Amount</th><th>Score</th><th>View History</th><th>Action</th></tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo $row['loanID'];
echo "</td><td>";
echo $row['loanAmt'];
echo "</td><td>";
echo $row['score'];
echo "</td>";
echo "<td>";
echo '<a href=creditHistory.php>View Credit History</a>';
echo "</td>";
echo "<td>";
echo "Approve/Reject";//this is where the user will click
echo "</td></tr>";so, what i want to do after this is, i want the user to be able to click on approve/reject, and the system will
automatically save the status into the database. im not sure what code to use, or even where to insert it in the loop..if it is possible,after the user clicks on approve/reject, i want that row of data to be deleted from the table.
any help will be greatly appreciated..thank you so much