₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,344,479 members, 8,512,109 topics. Date: Monday, 02 November 2026 at 08:44 PM

Toggle theme

Need Assistance With This - Programming - Nairaland

Nairaland Forum › Science/Technology › Programming › Need Assistance With This (1014 Views)

1 Reply (Go Down)

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:
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
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:
You will have to use the id of the currently viewed item in the where clause
yeah i have seen it was missing a auc_id
1 Reply

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