Reply to Re: Displaying user defined select

Your name:

Reply:


Posted by Pedro Graca on 10/11/06 09:17

Garry Jones wrote:
> The following code is the start of a the only way I know to do this. There
> must be an easier way as there can not be a need for 3600 variables for one
> funtion?

There's 1440 minutes in a day. How did you come up with 3600?

> So I would like to know how this is "supposed" to be done before I write my
> 10 800 lines of code.

Maybe like this?


// ...
$db_value = 815; // something between 0 and 2359; but 888 is invalid!!!

for ($i=0; $i<2360; ++$i) {
if ($i%100 < 60) {
echo '<option value="', $i;
if ($i == $db_value) {
echo ' selected="selected"';
}
echo '">', substr('0' . number_format($i/100, 2), -5), "</option>\n";
}
}
// ...

--
File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация