基本的に、私はオンラインで見つけたmySQLiラッパーを使用しています.
<?php
$res = $DB->Query("SELECT * FROM `table`");
while($row = $DB->Fetch()) {
?>
<tr>
<td><?php echo $row['id']; ?></td>
<td><?php echo $functions->checkStatus($row['arowhere']); ?></td>
</tr>
<?php
}
?>
したがって、これを実行しようとすると、テーブル行の$functions->checkStatus($row['arowhere']);
この関数内で新しいクエリが実行され、使用されている最新のクエリが変更されますwhile($row = $DB->Fetch()) {
public function Query($SQL) {
$this->SQL = $this->mysqli->real_escape_string($SQL);
$this->Result = $this->mysqli->query($SQL);
if ($this->Result == true) {
return true;
} else {
die('Problem with Query: ' . $this->SQL);
}
}
public function Fetch() {
return mysqli_fetch_assoc($this->Result);
}
解決策はありますか、誰かが私を正しい方向に向けてくれるので、これを避けることができます.