Activity Forums Salesforce® Discussions Sql request problem

  • Sql request problem

    Posted by Michel on June 1, 2021 at 12:15 pm

    Hi
    until now I used php 5.6 and for sql request i had created a dynamic syntax like this:

    
    
    function getInfo($table,$where,$field,$path="",$single="yes"){
    	$mySforceConnection=connectTOsf($path);
        $res=array();
        $tab_field=array();
      $contact="";
      $x=0;$z=0;
      try{ 
        $query = "SELECT ".$field." from ".$table." ".$where; 
      	$response = $mySforceConnection->query($query);   
        $queryResult = new QueryResult($response);
        $tab_field=explode(",",$field); 
      	for ($queryResult->rewind(); $queryResult->pointer < $queryResult->size; $queryResult->next()) 
      	{  
      		$record=$queryResult->current();
      		for($i=0;$i<count($tab_field);$i++)
                   {  
                       if($tab_field[$i]=="Id") $value=$queryResult->current()->Id;
                       else                     $value=$record->fields->$tab_field[$i];
                       ..... suite du traitement
                   }
           }
    .........

    It worked very well, but now with php7 the $value (not ID whose is static) are empty, and the values contain in $tab_field[$i] are correct.
    Is somebody can help me please?
    Thanks a lot in advance

    Michel replied 3 years, 5 months ago 1 Member · 0 Replies
  • 0 Replies

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos

Popular Salesforce Infographics