Jump to content

Addition of Rows


Cooper94

Recommended Posts

Is it possible to add the row values?

 

<?php
include 'db.php';
$sql = "SELECT * FROM pirerp WHERE status = '2'"; 
$result = mysql_query ($sql); 

while ($row = mysql_fetch_array($result)) 
{ 

$cargo = $row['cargo'];
echo $cargo;

}
?>

 

I am trying to add the values I can do "+=" but it gives me two values one added and one not. Thank you for your help!

Link to comment
https://forums.phpfreaks.com/topic/173477-addition-of-rows/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.