Dooling Posted January 30, 2007 Report Share Posted January 30, 2007 Kā lai realizē šādu lietu. Izvelkam no datubāzes datus. Un tad tos sareizinām. Piemērs: per_id | skaitlis 2006 | 6.5 2007 | 5 Man vajag, lai sareizinās 6.5*5=32.5? Link to comment Share on other sites More sharing options...
andrisp Posted January 30, 2007 Report Share Posted January 30, 2007 Pirms cikla $sum = 1; Kad ciklē cauri ierakstiem, tad: $sum = $sum * $row['skaitlis']; Link to comment Share on other sites More sharing options...
Delfins Posted January 30, 2007 Report Share Posted January 30, 2007 (edited) while ($cursor) { if ($row->value) { $value = ($value) ? $row->value * $value; : $row->value; } } Edited January 30, 2007 by Delfins Link to comment Share on other sites More sharing options...
Dooling Posted January 30, 2007 Author Report Share Posted January 30, 2007 Ok. Paldies par palīdzību :) Link to comment Share on other sites More sharing options...
Recommended Posts