[Vtigercrm-developers] vtiger 7.2 Query api return only 1 items

Alan Lord alanslists at gmail.com
Wed Mar 18 09:55:22 GMT 2020


On 18/03/2020 09:29, omriyona wrote:
> Hello,
> after the update to vtiger 7.2 the *query api return only one item* even if
> the sql return more.

Seems to work OK for me:

I created a test file:

 > <?php
 >
 > ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_STRICT & 
~E_DEPRECATED);
 > ini_set('display_errors','1');
 >
 > require_once('includes/main/WebUI.php');
 > require_once('include/Webservices/Query.php');
 >
 > $activeAdminUser = Users::getActiveAdminUser();
 > $query = "SELECT * FROM Accounts;";
 >
 > try {
 >         $result = vtws_query($query, $activeAdminUser);
 > } catch (WebServiceException $ex) {
 >         echo $ex->getMessage();
 > }
 >
 > print_r($result);

I have two Accounts in the test system. I get two results back.

If I change it to COUNT(*) I get the right answer

If I just ask for the accountname, e.g.

 > $query = "SELECT accountname FROM Accounts;";

I get two rows back with just the accountname.


Al




More information about the vtigercrm-developers mailing list