Re: Date increment in INSERT loop
One way ...
$conn = mysqli_connect( ... );
$userid = '...'
$d = "2021-05-03';
$n = 28;
for( $i=0; $i<$n; $i++ ) {
$q = "insert into roomsav set userid='$userid', sdate=adddate('$d' interval $i day)";
if( !mysqli_query($conn,$q) )
exit( $conn->error );
}
Subject
Written By
Posted
September 06, 2021 09:08AM
September 06, 2021 01:24PM
September 07, 2021 05:38AM
Re: Date increment in INSERT loop
September 07, 2021 09:09AM
September 08, 2021 02:30AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.