After getting very frustrated with arrays, I ended up using eval() in the
following way:

function top10() {
        $i = 0;
        $res = mysql_query("SELECT,, orders.amount,
products.pname FROM orders, products WHERE orders.uid!='' AND") or die(mysql_error());
        while (list($opid, $ppid, $amount, $pname) = mysql_fetch_row($res)) {
                $eval = '$temp["'.$pname.'"] = $temp["'.$pname.'"] + '.$amount.';';
        return $temp;

It works fine for me, though I don't really need to select and since they aren't used. They are there when I was debugging but
*shrug*, I'm just too lazy to remove them right now!


PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to