July 26th, 2013, 08:15 PM
SQL Query doesnt Insert Data Properly
We have a shopping cart with a basket. When the user is checked out the following query is executed
When we have a look at the back DB. The following fields are populated
$sql1="SELECT * FROM basket WHERE sessionID='".$sid."'";
but the loanID is only populated for the first item in the cart if there are say 3 items, the first one has the loanID populated whereas for the remaining 2 items it shows the LoanID as '0'.
For basic understanding, each borrower ID is associated with Loan ID and these values are properly generated in the DB in another table called Loan which inserts the values into the basket into the transactiondetail_temp table.
Can any advise as to what could be the problem.
July 27th, 2013, 01:46 AM
You could, for testing purposes, run var_dump($row) just inside the while loop