prepare('SELECT COUNT(*) AS total FROM accounts a ' . $where); if ($search) $stmt->bindParam('search', $param3, PDO::PARAM_STR); $stmt->execute(); $accounts_total = $stmt->fetchColumn(); // SQL query to get all products from the "products" table $stmt = $pdo->prepare('SELECT a.*, count(t.id) AS orders FROM accounts a LEFT JOIN transactions t ON t.account_id = a.id ' . $where . ' GROUP BY a.id, a.email, a.password, a.role, a.first_name, a.last_name, a.address_street, a.address_city, a.address_state, a.address_zip, a.address_country, a.registered ORDER BY ' . $order_by . ' ' . $order . ' LIMIT :start_results,:num_results'); // Bind params $stmt->bindParam('start_results', $param1, PDO::PARAM_INT); $stmt->bindParam('num_results', $param2, PDO::PARAM_INT); if ($search) $stmt->bindParam('search', $param3, PDO::PARAM_STR); $stmt->execute(); // Retrieve query results $accounts = $stmt->fetchAll(PDO::FETCH_ASSOC); // Handle success messages if (isset($_GET['success_msg'])) { if ($_GET['success_msg'] == 1) { $success_msg = 'Account created successfully!'; } if ($_GET['success_msg'] == 2) { $success_msg = 'Account updated successfully!'; } if ($_GET['success_msg'] == 3) { $success_msg = 'Account deleted successfully!'; } } // Determine the URL $url = 'index.php?page=accounts&search=' . $search; ?>

Accounts

View, create, and edit accounts.

Create Account
# Email Name Address Role Orders Placed Registered Date Actions
There are no accounts
Edit