Dooling Posted January 30, 2007 Report 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?
andrisp Posted January 30, 2007 Report Posted January 30, 2007 Pirms cikla $sum = 1; Kad ciklē cauri ierakstiem, tad: $sum = $sum * $row['skaitlis'];
Delfins Posted January 30, 2007 Report Posted January 30, 2007 (edited) while ($cursor) { if ($row->value) { $value = ($value) ? $row->value * $value; : $row->value; } } Edited January 30, 2007 by Delfins
Recommended Posts