Home » Php » javascript – How to move records/data of bookings table if the dates are older than 1 day to another expired app table in MYSQL

javascript – How to move records/data of bookings table if the dates are older than 1 day to another expired app table in MYSQL

Posted by: admin February 25, 2020 Leave a comment

Questions:

PHP bookings table

<?php 
    if(mysqli_num_rows($query_run)>0)
    {
        while($row= mysqli_fetch_assoc($query_run))
        {
            ?>


     <tr>
        <td><?php echo $row['booking_id']; ?> </td>
        <td> <?php echo $row['name']; ?></td>
        <td><?php echo $row['email'];?></td>
        <td><?php echo $row['timeslot'];?> </td>
         <td><?php echo $row['dates'];?> </td>
        <td>
            <form action="codecancel.php" method="post">
                <input type="hidden" name="codecancel_id" value="<?php echo $row['booking_id']; ?> ">
                <button  type="submit" name="codecancel_btn" class="btn btn-danger"> CANCEL</button>
            </form>
        </td>

      </tr>
    <?php
        }
    }
    else {

        echo" No Appointment Found";
    }
 ?>

How to move records/data of bookings table if the dates are older than 1 day to another expired app table in MYSQL

This is bookings table in PHPMyAdmin

enter image description here

This is expiredapp table in PHPMyAdmin
enter image description here

For example, the dates are 2020-02-12 I want the dates are deleted to bookings table and insert to expiredapp table based on the dates field.

but I don’t know the code for that.

How to&Answers: