You are here: Re: mysql_fetch_array for loop « PHP Programming Language « IT news, forums, messages
Re: mysql_fetch_array for loop

Posted by Chung Leong on 10/29/81 11:33

Probably easier to just remember the previous value as your loop
through the array.

$prev_value = -1;
$prev_date = 0;
foreach($close as $date => $value) {
if($prev_value >= 0) {
// draw line from closing value from previous date
// current value
}
else {
$first_date = $date;
}
$prev_value = $value;
$prev_date = $date;
}

I'm using the date as the index here, since that'll probably be needed
for drawing the chart.

 

Navigation:

[Reply to this 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

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