Jump to content

new database connection issue


skyhighweb

Recommended Posts

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 by skyhighweb
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...