データベースからデータを取得してHTMLで表示させたいですが、うまくいきません。
どこがおかしいでしょうか???
エラーは以下の通りです。
Parse error: syntax error, unexpected end of file in /home/ubuntu/workspace/bootstrap-3.3.7-dist/showpage3.php on line 36
<?php require('present.php'); $recordset = mysqli_query('select * from present'); if ($result = $mysqli->query($recordset)) { // 連想配列を取得 while ($row = $result->fetch_assoc()) { echo $row["*"] . "<br>"; } // 結果セットを閉じる $result->close(); ?> <html> <body> <table width="80%" border="1"> <tr> <th scope="col">商品名</th> <th scope="col">紹介文</th> <th scope="col">企業名</th> <th scope="col">url</th> </tr> <?php while($table = mysqli_fetch_assoc($recordset)) { ?> <tr> <td><?php print(htmlspecialchars($table['name'])); ?> </td> <td><?php print(htmlspecialchars($table['introduce'])); ?> </td> <td><?php print(htmlspecialchars($table['gazou'])); ?> </td> <td><?php print(htmlspecialchars($table['companyname'])); ?> </td> <td><?php print(htmlspecialchars($table['url'])); ?> </td> </tr> <?php } ?> </table> </body> </html>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/08/21 07:18
2017/08/21 07:20
2017/08/21 07:44
2017/08/21 07:46
2017/08/21 08:02