Valentina PHP 2.1 sql select sum()

Damon Pillinger daisychain at iinet.net.au
Fri Feb 10 10:44:38 CST 2006


Hi Ruslan,

Ok read the examples but none use a Count(*) or SUM() so we cannot use
the field name i.e. $obj->cCalled cannot be $obj->Count(*)

$res = valentina_query("Select cCalled, sum(cDion) ,count(*) FROM Person
where cCustomer='42000' GROUP BY cCalled");
  for( $i = 0; $i < valentina_num_rows($res); $i++)
  {
    $obj = valentina_fetch_object( $res );
    echo $obj->cCalled."  ".$obj[0]."  ".$obj[1]."  ";
    echo "<br>";
  }

This just returns the cCalled part fine but then empty strings after.

And as per numeric example $obj[1] should work if I change it to
$obj[$f] where $f =1 then I get the same result.

Thanks

Best regards

Damon L. Pillinger
Director Daisychain EDi
Suite 3
4 Winston Court
Moorabbin 3189
Phone : +61 3 9532 1220
Fax : +61 3 9532 1280



More information about the Valentina mailing list