我很难解决这个问题:需要帮助请..
这是我的原始代码:
函数.php
public function getTestScriptSummary($projectID){
$sql = "SELECT * FROM tbl_test_script_header WHERE fld_projectID='$projectID'";
$query = $this->DBH->prepare($sql);
$query->execute();
while($row = $query->fetch(PDO::FETCH_ASSOC)){
$testResults .= "
<tr>
<td style=\"padding:3px;\">".$row['fld_dateEnded']."</td>
<td style=\"padding:3px;\">".$row['fld_testerName']."</td>
<td style=\"padding:3px;\">".$row['fld_scriptID']."</td>
<td style=\"padding:3px;\">".$row['fld_testPhase']."</td>
<td style=\"padding:3px;\">".$row['fld_status']."</td>
</tr>";
}
return $testResults;
}
视图.php
echo $User->getTestScriptSummary($_POST['projectName']);
使用此代码,我得到了正确的答案。但我不想在我的函数中显示表格(我的意思是 testResults 中的值)。相反,我希望它显示在 view.php 中。我将如何做到这一点?