Valentina PHP 2.1 sql select sum()

Damon Pillinger daisychain at iinet.net.au
Fri Feb 10 11:12:10 CST 2006


Figured it out
$arr = valentina_fetch_row( $res );
not
$obj = valentina_fetch_object( $res );

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


-----Original Message-----
From: valentina-bounces at lists.macserve.net
[mailto:valentina-bounces at lists.macserve.net] On Behalf Of Damon
Pillinger
Sent: Friday, 10 February 2006 10:45 AM
To: 'Valentina Developers'
Subject: RE: Valentina PHP 2.1 sql select sum()

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

_______________________________________________
Valentina mailing list
Valentina at lists.macserve.net
http://lists.macserve.net/mailman/listinfo/valentina


More information about the Valentina mailing list