nope heres the full code below
this is the count
// Retrieve close games from the database
$params = array();
if (isset($Q))
{
$query = "SELECT a.*, b.bid, COUNT(b.bid) as COUNT FROM " . $DBPrefix . "auctions a
LEFT JOIN " . $DBPrefix . "bids_score b ON (b.auction = a.id)
" . $Q;
}
elseif (isset($_POST['keyword']))
{
$keyword = $system->cleanvars($_POST['keyword']);
$query = "SELECT a.*, b.bid, COUNT(b.bid) as COUNT FROM " . $DBPrefix . "auctions a
LEFT JOIN " . $DBPrefix . "bids_score b ON (b.auction = a.id)
WHERE a.user = '1' AND a.closed = 1 AND b.quantity = 1 AND (b.id LIKE :id)";
$params[] = array(':team1', '%' . $keyword . '%', 'int');
$params[] = array(':team2', '%' . $keyword . '%', 'int');
$params[] = array(':id', '%' . $keyword . '%', 'int');
$params[] = array(':nick', '%' . $keyword . '%', 'str');
}
else
{
$query = "SELECT a.*, b.bid, COUNT(b.bid) as COUNT FROM " . $DBPrefix . "auctions a
LEFT JOIN " . $DBPrefix . "bids_score b ON (b.auction = a.id)
WHERE a.user = '1' AND a.closed = 1 AND b.quantity = 1 ";
}
$db->query($query, $params);
$TOTALUSERS = $db->result('COUNT');
while this displays the table
$params = array();
if (isset($Q))
{
$query = "SELECT a.*, bc.all_clicked AS all_clicked_fts, bc.nottagged_clicked, bc.team2_clicked, bc.team1_clicked, bc.paid_error_clicked AS paid_error_clicked_fts, b.auction AS auction, b.bid, u.nick, u.id AS nick_id, s.team_id, s.teams AS teams1, ss.team_id, ss.teams AS teams2, c.cat_name FROM " . $DBPrefix . "auctions a
LEFT JOIN " . $DBPrefix . "users u ON (u.id = a.user)
LEFT JOIN " . $DBPrefix . "sports s ON (s.team_id = a.team1)
LEFT JOIN " . $DBPrefix . "sports ss ON (ss.team_id = a.team2)
LEFT JOIN " . $DBPrefix . "categories c ON (c.cat_id = a.category)
LEFT JOIN " . $DBPrefix . "bids_score b ON (b.auction = a.id)
LEFT JOIN " . $DBPrefix . "buttonclicked_score bc ON (bc.auction_id = b.auction)
" . $Q;
}
elseif (isset($_POST['keyword']))
{
$query = "SELECT a.*, bc.all_clicked AS all_clicked_fts, bc.nottagged_clicked, bc.team2_clicked, bc.team1_clicked, bc.paid_error_clicked AS paid_error_clicked_fts, b.auction AS auction, b.bid, u.nick, u.id AS nick_id, s.team_id, s.teams AS teams1, ss.team_id, ss.teams AS teams2, c.cat_name FROM " . $DBPrefix . "auctions a
LEFT JOIN " . $DBPrefix . "users u ON (u.id = a.user)
LEFT JOIN " . $DBPrefix . "sports s ON (s.team_id = a.team1)
LEFT JOIN " . $DBPrefix . "sports ss ON (ss.team_id = a.team2)
LEFT JOIN " . $DBPrefix . "categories c ON (c.cat_id = a.category)
LEFT JOIN " . $DBPrefix . "bids_score b ON (b.auction = a.id)
LEFT JOIN " . $DBPrefix . "buttonclicked_score bc ON (bc.auction_id = b.auction)
WHERE a.user = :user_id AND b.quantity = 1 AND a.closed = 1 AND a.num_bids > '0' AND (s.teams LIKE :team1 OR ss.teams LIKE :team2 OR a.id LIKE :id) GROUP BY a.id";
$params[] = array(':team1', '%' . $keyword . '%', 'int');
$params[] = array(':team2', '%' . $keyword . '%', 'int');
$params[] = array(':id', '%' . $keyword . '%', 'int');
}
else
{
$query = "SELECT a.*, bc.all_clicked AS all_clicked_fts, bc.nottagged_clicked, bc.team2_clicked, bc.team1_clicked, bc.paid_error_clicked AS paid_error_clicked_fts, b.auction AS auction, b.bid, u.nick, u.id AS nick_id, s.team_id, s.teams AS teams1, ss.team_id, ss.teams AS teams2, c.cat_name FROM " . $DBPrefix . "auctions a
LEFT JOIN " . $DBPrefix . "users u ON (u.id = a.user)
LEFT JOIN " . $DBPrefix . "sports s ON (s.team_id = a.team1)
LEFT JOIN " . $DBPrefix . "sports ss ON (ss.team_id = a.team2)
LEFT JOIN " . $DBPrefix . "categories c ON (c.cat_id = a.category)
LEFT JOIN " . $DBPrefix . "bids_score b ON (b.auction = a.id)
LEFT JOIN " . $DBPrefix . "buttonclicked_score bc ON (bc.auction_id = b.auction)
WHERE a.user = :user_id AND b.quantity = 1 AND a.closed = 1 AND a.num_bids > '0' GROUP BY a.id ORDER BY a.ends DESC LIMIT :offset, :perpage";
}
$params[] = array(':offset', $OFFSET, 'int');
$params[] = array(':user_id', $user->user_data['id'], 'int');
$params[] = array(':perpage', $system->SETTINGS['perpage'], 'int');
$bg = '';
not sure why this count is given issue