ここで一日中頭を打っています。コードで SQL インジェクションを防止しようとした最初の経験なので、準備されたステートメントを使用していて、結果をループすると出力が空白になりますが、それはテーブルであるため、すべてのセルがそこにあり、データはありません。私のコード: include_once("../includes/connect.php");
$query = "SELECT * FROM `boards` WHERE `team_id` = ? ORDER BY name ASC";
$stmt = $con->prepare($query);
$stmt->bind_param("s", $board);
$stmt->execute();
echo "<table border='1' class='table table-bordered'>
<tr>
<th>Name</th>
<th>In/Out</th>
<th>Note</th>
</tr>";
while ($row = mysqli_stmt_fetch($stmt))
{
echo "<tr>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['inout'] . "</td>";
echo "<td>" . $row['note'] . "</td>";
echo "</tr>";
}
echo "</table>";
//for troubleshooting
var_dump($stmt)
そして、これは次のようになります。
http://i.stack.imgur.com/A1kKg.png
データが入力されない理由はありますか? どんな助けでも大歓迎です!ありがとう!