How to make countdown with record count

I am rebuilding a website with a sign-up form. There only 20 beds in a cabin available. In the signup form I want to show how many beds are available, counting down from 20 and stop showing the option when all beds are reserved. In mysql I used to do it with

<?php if ("".(20 - $countzwerf->TotalRows) ."" != "0") { // Show If ?> Ik wil een bedje in een zwervershut (+€ 10,00, nog <?php echo (20 - $countzwerf->TotalRows) ?> beschikbaar)<?php

} // ("".(20 - $countzwerf->TotalRows) ."" != “0”)
?>

Community Page
Last updated: