title: Issue Undefined variable after storing mysql query into a php variable
body: <p>I have an issue on my php script. I am trying to store mysql query into a php variable and then I convert the result to string. It seems doing the job in the loop but at the end of my script, I have an error:</p>
  
  <p>Internal Error -</p>
  
  <blockquote>
    <p>Notice:Undefined variable: result</p>
  </blockquote>
  
  <p>I want to pass the whole content of the variable $data.
  Do you know what i am doing wrong? </p>
  
  <p><strong>Here my php script</strong>:</p>
  
  <pre><code>&lt;?php
  if (isset($_GET['data']) &amp;&amp; $_GET['data']) {
  $SelectDataFromRunTable="Select Reference, Variant, HGVSVar FROM run29012016";
  $QueryResult=mysqli_query($conn,$SelectDataFromRunTable);
  while($data = mysqli_fetch_array($QueryResult,MYSQLI_BOTH)){
  print_r($data);
  $data=implode(" ",$data);
  }//end of while
  $NameChecker='astringtest';
  $options = array('features' =&gt; SOAP_SINGLE_ELEMENT_ARRAYS);
  
      $client = new SoapClient($URL, $options);
  try {
     $result = $client-&gt;submitBatchJob(array('data'=&gt;$data, 'process'=&gt;$NameChecker))
                    -&gt;submitBatchJobResult;
  
      } catch (Exception $e) {
          echo $e-&gt;getMessage();
      }
  
  
  print_r($result);
  
  mysqli_close($conn);
  }
  ?&gt;
  </code></pre>