0

I'm having issues with this php code. The getDatabase() function usually returns a string but sometime it returns an array. I tried to correct this using lines 3 through 5 but this has not corrected it, as it still produces the " Array to string conversion error" on the "echo $compoundId" line.

$compoundIdt= getDatabase("Select compound_id from compound where dsrt_id = '" . $localId[0] . ".;");
            //debug for multiples
            if (is_array($compoundIdt) ){
                $compoundId= array_slice($compoundId,0,1);
            }
            echo $compoundId;//produces error
Chris Chevalier
  • 620
  • 1
  • 7
  • 20

0 Answers0