Need Assistance With This - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Need Assistance With This (1014 Views)
| Need Assistance With This by skyhighweb(op): 10:36am On Mar 25, 2017 |
need your help here, am trying to deduct balance from minimum_bid in auction table, it working fine but problem is its only deducting from the top of the column instead of the what item is being displayed at the moment below is the code, thanks. // work out & add fee $query = "SELECT minimum_bid, fee_type FROM " . $DBPrefix . "auctions"; $db->direct_query($query); $row = $db->result(); $fee_type = $row['fee_type']; if ($row['fee_type'] == 'flat') { $fee_value = $row['minimum_bid'] * $qty; } |
| Re: Need Assistance With This by hollyfat(m): 10:46am On Mar 25, 2017 |
My observation is that you are only querying the table without any condition. It will automatically select the first entry. Try using a WHERE Clause |
| Re: Need Assistance With This by skyhighweb(op): 10:55am On Mar 25, 2017 |
hollyfat:tried using that but it seem to either stop working or still select from the first entry column in the auction table are id fee_type minimum_bid |
| Re: Need Assistance With This by hollyfat(m): 6:41pm On Mar 25, 2017 |
You will have to use the id of the currently viewed item in the where clause |
| Re: Need Assistance With This by skyhighweb(op): 7:06pm On Mar 25, 2017 |
hollyfat:yeah i have seen it was missing a auc_id |
Assistance With Ethereum Smart Contracts In Python • 2 • 3 • 4
I Need A Technical Co-founder Knowledgeable In React Native (javascript). • Is This Possible • Be A Software Tester- API Testing And API Test Tools