Display results to another php page from a select statement using a function
<p>I had a hard time solving this: Need help pls..</p>

<p>Here's my original code:</p>

<hr>

<p><strong>function.php</strong></p>

<pre><code>public function getTestScriptSummary($projectID){

    $sql = "SELECT * FROM tbl_test_script_header WHERE fld_projectID='$projectID'";
    $query = $this-&gt;DBH-&gt;prepare($sql);
    $query-&gt;execute();

    while($row = $query-&gt;fetch(PDO::FETCH_ASSOC)){
        $testResults .= "
            &lt;tr&gt;
                &lt;td style=\"padding:3px;\"&gt;".$row['fld_dateEnded']."&lt;/td&gt;
                &lt;td style=\"padding:3px;\"&gt;".$row['fld_testerName']."&lt;/td&gt;
                &lt;td style=\"padding:3px;\"&gt;".$row['fld_scriptID']."&lt;/td&gt;
                &lt;td style=\"padding:3px;\"&gt;".$row['fld_testPhase']."&lt;/td&gt;
                &lt;td style=\"padding:3px;\"&gt;".$row['fld_status']."&lt;/td&gt;
            &lt;/tr&gt;"; 
    }
    return $testResults;
}
</code></pre>

<p><strong>view.php</strong></p>

<pre><code>  echo $User-&gt;getTestScriptSummary($_POST['projectName']); 
</code></pre>

<hr>

<p>With this code, I got the right answers. But I dont want to display the table (the value in the testResults i mean) here in my function. Instead i want it to display in the view.php. How will i do that? </p>
