$query = "SELECT * FROM users WHERE id = 1"; $row = $db->query_row($query); echo "Name: " . $row['name'] . "
"; echo "Email: " . $row['email'] . "
"; echo "Phone: " . $row['phone'] . "
";
$query = "SELECT COUNT(*) AS total FROM orders WHERE status = 'paid'"; $row = $db->query_row($query); echo "Total Paid Orders: " . $row['total'];This code retrieves the first row of data from the "orders" table where the "status" is set to "paid". It then echoes out the total number of paid orders. The DB query_row function is a part of the PEAR DB package library.