Hy i have two tables articles and iniziale, articles have a collum c2,and iniziale have c1 i whant to do like this c1(whic its have one value only)- sum(c2)(entire collum)
ive tryied like this but nothing...:(

                 <?php

$result = mysql_query("SELECT *,SUM(iCarl)-SUM(CarrelliCC22) as total2 from articles,iniziale");  
$row= mysql_fetch_assoc($result);

echo "<h4>" . $row['total2'] . "</h4>";

?>
  <?php

$result = mysql_query("SELECT *,iCarrelli-SUM(Carrelli) as total5   FROM articles,inc");  
$row= mysql_fetch_assoc($result);

echo "" . $row['total5'] . "";

?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.