Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,193,921 members, 7,952,705 topics. Date: Wednesday, 18 September 2024 at 09:50 PM

Need Assistance With This - Programming - Nairaland

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

Assistance With Ethereum Smart Contracts In Python (2) (3) (4)

(1) (Reply) (Go Down)

Need Assistance With This by skyhighweb(m): 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(m): 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(m): 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)

HTML/CSS N JAVA Pro Needed / Sports Betting Software Or Script Needed / Joomla: How To Link A Text To A Definite Joomla Category

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 8
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.