How to Get Tomorrow Records in PHP MySQL?

Feb 14, 2022 . Admin

Hello Friends,

I am going to explain you example of how to get tomorrow records in PHP?. You will learn how to check tomorrow records in PHP query. I would like PHP select record that should have tomorrow records. This article will give you simple example of how to get tomorrow records in PHP query.

We will use get search how to select tomorrow records PHP. You can understand a concept of search PHP interval 1 day. So, we can illustrate the getting a tomorrow record get in PHP. We will instruct PHP get tomorrow records.

You can see both example of how do I get get tomorrow records in PHP server.

Table: users


So, let's see bellow solution:

index.php
<?php

$servername = "localhost";
$username = "root";
$password = "root";
$dbname = "db_php";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

$sql = "SELECT 
            * 
        FROM `users` 
        WHERE DATE(created_at) = ADDDATE(CURDATE(),1);

$result = $conn->query($sql);

while ($row = $result->fetch_assoc()) {
    echo '<pre>';
    print_r($row);
}

?>
Output:
Array
(
    [id] => 3
    [name] => Haresh
    [email] => savanihd2@gmail.com
    [created_at] => 2022-02-15 06:46:08.000000
    [updated_at] => 2020-09-18 12:04:09.000000
)
It will help you...
#PHP