Re: something is wrong with my array

From: Date: Thu, 01 Jan 1970 00:00:00 +0000
Subject: Re: something is wrong with my array
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-13237@lists.php.net to get a copy of this message
Send us the actual error you recieve from php. I only use MySQL but I'll do me best! Russ > please help... my script below does not work as it should. i think theres something wrong with > my > array ... > > > // Query items ordered > $sql = "select qty,productdesc,productsize,productprice from tblCart c, tblProduct p WHERE > > p.prodid=c.prodid and c.cartid='".$cartid."' ORDER BY productdesc"; > $query = ibase_query($sql); > $total=0; $Count=0; > while ($Coutrow = ibase_fetch_row($query)) { $subtotal = $Coutrow{3} * $Coutrow{0}; > $total = $total + $subtotal; if ($BoughtCount==0) { > $ProdArray = > > array(qty=>$Coutrow{0},prodname=>$Coutrow{1},prodsize=>$Coutrow{2},prodprice=>number_format($Coutrow{3},2),prodtotal=>number_format($subtotal,2)); > } else { > $ProdArray = > > $ProdArray.",".array(qty=>$Coutrow{0},prodname=>$Coutrow{1},prodsize=>$Coutrow{2},prodprice=>number_format($Coutrow{3},2),prodtotal=>number_format($subtotal,2)); > } > $Count ++; } > > // Display items ordered > $CartItems = array ($ProdArray); for ($i=0; $i<=$Count; $i++) { > print "<tr><td width=\"10%\" align=\"right\" > class=\"prodtxt\">".$CartItems[$i][qty]."</td> > <td align=\"left\" > class=\"prodtxt\">".$CartItems[$i][prodname]."</td> <td > align=\"right\" > class=\"prodtxt\">".$CartItems[$i][prodsize]."</td> <td > align=\"right\" > > class=\"prodtxt\">".number_format($CartItems[$i][prodprice],2)."</td> > <td align=\"right\" > > class=\"prodtxt\">".number_format($CartItems[$i][prodtotal],2)."</td></tr>"; > } > > > thanks in advance #-------------------------------------------------------# "Believe nothing - consider everything" Russ Michell Anglia Polytechnic University Webteam Room 1C 'The Eastings' East Road, Cambridge e: r.j.michell@apu.ac.uk w: www.apu.ac.uk/webteam www.theruss.com #-------------------------------------------------------#

« previous php.db (#13237) next »