I'm trying to get the total for each product and add them for a Grand Total to list outside the loop or only echo once I can do the addition but it will echo 5 time in the loop.
How would I go about doing this?
Thanks in advance for your help.
Code: <?php
$cart2="SELECT * FROM products WHERE pro_indid='glass'";
$res2 = mysql_query($cart2) or die('Error, query failed 2');
while($cr2=mysql_fetch_array($res2)){
$totrow=$cr2["total"];
///the $totrow will echo below 5 time each price in database 5.67 which the total should be 28.35 //
echo $totrow;
}
///Output of total would be $28.35
?>
The output I'm looking for would be like so
5.67
5.67
5.67
5.67
5.67
GrandTotal:28.35
Create multiple (n) arrays
Hi there,I have the following need:I have 2 arrays (coming from a databases)Array2 is related to Array1 -Example:Array1Dog, abcCat, bcdHorse, cdeArray2,meat, abcbones, abcfish, bcdgrain, cdegrass,
my sql select id and then update problem.
I need to select some auto incremented ids out of a database and then use those id in a where statement which updates the database at the id's location the below code works up to the update statements
Creation of Raw Exposure manually
SAP Gurus
php not working written for consumption of slots
1. Here is the function where i will be allowed to consume the slot booked by me.2. Here i check the unique reservation id, current server time & date.3. Then i ask the user to enter the
Simple MySQL query...
Hello,How could I do a mysql query that does this: SELECT * WHERE date/time < 5minutes ago? Also, what type of field will I need to create in the database? date/time or just time? And, what
button help
i originally had this but realised it is much easier to have a button.Code: <?php$search = $_GET['search'];$checkbox = $_GET['checkbox'];if($checkbox ==
Help with forum quoting?
Hi im working on a forum and I have alomost finished it but i want a user quote system like twitter and facebook with the @ sign to start it off, however even though im good at php coding and have
Binding 2 UDP sockets on same port, connected to different destinations, 1 receives
Hello,
pagination - need help on passing of search query.
Hi, i have been trying for days but couldn't get this sorted out. Would like some professional help here. Basically I got a basic pagination script from google search and the script works absolutely
help countdown timers
hello every one,I'd like to know how to insert many countdowns in the same page.The duration of each must be different and defined by members with a form.