I’m not sure I can give any more assistance without actually just writing all the code for you. I’ve shown the steps involved. I can’t see why, if you wrote the code you posted, you can’t get this working. You almost had it in post #14, just need to execute the first query and retrieve the results.
Sorry, I’m sure someone else will come and post some helpful advice soon.
// get values for viewing bidder, you might already have these
"SELECT team1_score, team2_score FROM " . $DBPrefix . "bids_perfect_score WHERE bidder = :viewbidder and auction = :auc_id";
// store results in $viewer// get other rows with the same values
"SELECT auction FROM " . $DBPrefix . "bids_perfect_score WHERE team1_score = $viewer[team1_score] and team2_score = $viewer[team2_score] and bidder <> :viewbidder and auction=:auc_id";
$params = array();
$params[] = array(':auc_id', $id, 'int');
$params[] = array(':viewbidder', $user->user_data['id'], 'int');
$db->query($query, $params);
$AUCTION = $db->result();
$template->assign_vars(array(
'BIDDERPERFECTTOTALDOWN' => htmlspecialchars($AUCTION['viewer'])
));
ok a bit advice what should be done here plz explain softly so i can work on it from there, thansk
hi it worrks but not the way i want it, this code counts well d total amount of match value but doesnt count the number of bidders who choose the same values as the bidder viewing the page.
ok i finally got it to work sorry for late replies been busy offine
$query = "SELECT *, COUNT(*) + 1 AS samebettor FROM " . $DBPrefix . "bids_perfect_score WHERE auction = :auc_id and user != :user and team1_score = :team1_score and team2_score = :team2_score limit 1";