Home  >  Q&A  >  body text

Retrieve a user's check-in date: a step-by-step guide

Hello, I would like to be able to display the registration date of users after January 25, 2022 But my query always shows the same date

$sqlQuery = 'SELECT * FROM _users WHERE user_registered > "2022-01-25"';
$recipesStatement = $bdd->prepare($sqlQuery);
$recipesStatement->execute();
$recipes = $recipesStatement->fetchAll();

// On affiche chaque date une à une
foreach ($recipes as $recipe) {
?>
    <p><?php echo $recipe['user_registered']; ?></p>
    
<?php
}

P粉423694341P粉423694341373 days ago367

reply all(1)I'll reply

  • P粉958986070

    P粉9589860702023-09-13 09:08:11

    sqlQuery = 'SELECT * FROM _users WHERE user_registered > "2022-01-25 00:00:00"';
    $recipesStatement = $bdd->prepare($sqlQuery);
    $recipesStatement->execute();
    $recipes = $recipesStatement->fetchAll();
    
    // On affiche chaque date une à une
    foreach ($recipes as $recipe) {
    ?>
        <p><?php echo $recipe['user_registered']; ?></p>
        
    <?php
    }

    reply
    0
  • Cancelreply