Hello,
I am trying to echo results from mysql.
I have a table 'rb_pallet_record' and a column 'quantity' which records the amount of products.
What I would like to do is calculate all of the quantity data echoing the total.
ie.
quantity
5
8
7
5
total = 25
here is the php i am working with
PHP Code:
<?php $link = mysql_connect('localhost', 'root', 'taycon');
if (!$link) { die('Could not connect: ' . mysql_error());}echo '';mysql_select_db("rb");?>
<?php
$sql = "select count(quantity) from rb_pallet_record";
$result=mysql_query($sql,$link)or die(mysql_error());
$row = mysql_fetch_array($result, MYSQL_NUM);
echo $row[0];
?>
Thanks
Bookmarks