RE: [PHP] Incrementing dates

From: Date: Sun, 22 Apr 2001 11:12:36 +0000
Subject: RE: [PHP] Incrementing dates
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-49738@lists.php.net to get a copy of this message
PHPBeginner.com wrote: > > INSERT INTO table SELECT date+INTERVAL 10 DAYS AS date FROM table WHERE > bla=bla; > > it is just a way to do it. you will definitely have to play with it. > > However you can easily make two queries to read the previous date > combining it with INTERVAL and then do an insert. I've looked at INTERVAL but it seems it only deals with one specific date at a time? date=10 : SELECT date+INTERVAL 10 would then mean date=20 Or have I got everything wrong? What I looking at from the value of date=10 ADD other dates for X days on, like this (in a table, each record (row) has more data than the one given) date=2001-04-10 date=2001-04-11 date=2001-04-12 This, if I'm mistaken can't be done with interval, at least not without looping in PHP? And using two queries would not perhaps save as much code as the way I solved it? Could be mistaken of course. Martin S.

« previous php.general (#49738) next »