skyhighweb Posted May 18, 2017 Share Posted May 18, 2017 (edited) hi how do i rewrite this $country_result = $conn->query('select * from sports'); and this $bids_result = $conn->query('select * from bids where willwin='.$willwin.''); $options = "<option value=''>Select Name</option>"; while($row = $bids_result->fetch_assoc()) { $options .= "<option value='".$row['id']."'>".$row['bidder']."</option>"; to work like this $query = "SELECT a.id, a.team1, a.team2, b.auction, b.bidder, b.tagged, b.willwin, b.willlose FROM " . $DBPrefix . "auctions a LEFT JOIN " . $DBPrefix . "bids b ON (b.auction = a.id) WHERE a.id = :auc_id and a.id = a.id group by a.id"; $params = array(); $params[] = array(':auc_id', $id, 'int'); $db->query($query, $params); thanks Edited May 18, 2017 by skyhighweb Link to comment Share on other sites More sharing options...
justsomeguy Posted May 18, 2017 Share Posted May 18, 2017 What are $conn and $db? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now