RE: [PHP] question about for loop and mysql dates

From: Date: Tue, 22 Apr 2003 20:15:53 +0000
Subject: RE: [PHP] question about for loop and mysql dates
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-144900@lists.php.net to get a copy of this message
Why are you starting your for loop on 1? 1 is not really a valid time stamp. What is in $time_start and $time_end? > -----Original Message----- > From: Cory Hicks [mailto:chicks@tri-intl.com] > Sent: Tuesday, April 22, 2003 12:47 PM > To: php-general@lists.php.net > Subject: [PHP] question about for loop and mysql dates > > > Hello to all! > > Ok...been searching on google and the archives for a while now, nothing > is jumping up and giving me a clue :-) > > I am trying to build a drop-down box with a range of dates (mysql > formatted): > > $result = mysql_query($sql) > $row = mysql_fetch_array($result); > $time_start = $row["time_period_start"]; > $time_end = $row["time_period_end"]; > > for ($count=1; $count<=$time_end; $count++) { > echo "<option value='" . $count . "'>" . $count . > "</option>"; > } > > I have tried a whole heap of variations on this..I still get 1-15 in a > drop down or nothing at all. > > Any gurus out there care to offer a finger pointing me in the right > direction? > > Many thanks! > > Cory > -- >

« previous php.general (#144900) next »