Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $breaksQ = $db->query("SELECT * FROM users WHERE on_break = 1");
- $breaks = $breaksQ->results();
- $countbreaks = $breaksQ->count();
- echo $countbreaks;
- if ($countbreaks == 1) {
- ?>
- <h3>There is <?=$countbreaks?> person on break right now.</h3>
- <?php foreach ($breaks as $b){
- echo $b->fname;
- echo "<br>";
- }
- }
- elseif ($countbreaks > 1) {
- ?>
- <h3>There are <?=$countbreaks?> people on break right now.</h3>
- <?php foreach ($breaks as $b) {
- echo ucfirst($b->fname);
- echo "<br>";
- }
- } else {
- echo "<h3>There is no one on break right now.</h3>";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement