All pastes #73386 Raw Edit

barfz0r

public text v1 · immutable
#73386 ·published 2006-06-27 19:49 UTC
rendered paste body
while($row = $best_selling_rs->FetchRow())
{

	$most_sold_sql = 'select count(itemcode) as total_sold, itemcode from shoppingcart where itemcode = "'.$row['itemcode'].'" group by itemcode';

	$most_sold_rs  = $db->Execute($most_sold_sql);

	$best_selling .= $most_sold_rs->fields['total_sold'].': '.$most_sold_rs->fields['itemcode'].'<br />';

}


// produces the following infoz...
//
// How can i find out which itemcode has the largest number?

30: csg
146: famt
42: nfb0301
68: peg199
75: tosl0502
18: wsb0401
220: dd
27: stug0305