phpMyAdmin
 sql >> Database >  >> Database Tools >> phpMyAdmin

Limita la registrazione a 4 persone sul modulo di registrazione

prova questo puoi usare un alias per COUNT(*)

<?php        
    $connection=mysqli_connect("host", "username", "password", "database");
    $sql="SELECT COUNT(*) as cnt from database_users";
    $res = mysqli_query($connection, $sql);
    $users = $result->fetch_assoc(); 
    if ($users['cnt'] < 4) {
?>

    // html goes here, outside of the php tags

<?php
    } else {

        echo "Sorry, you have reached the user account limit.";

    }
?>