我是
PHP的新手,我正在尝试使用
PHP构建一个网站.我有localhost用于测试结果,我已经在网站上安装了PHPmyadmin.
我现在要做的是从数据库“portal”列出我的表“property”的内容,并用结果填充表格.
我正在使用MysqLi_query,MysqLi_fetch_array和while循环.我收到以下错误:
Warning: MysqLi_fetch_array() expects parameter 1 to be MysqLi_result,
boolean given in C:\xampp\htdocs\falcon\portal\forms\edit listing.PHP
on line 15
session_start(); require_once "connect_to_MysqL.PHP"; // where i store username and password to access my db. $sqlCommand = "SELECT * property FROM portal"; // dbname: portal - table: propery $query = MysqLi_query($myConnection,$sqlCommand); $Displayproperty = ''; while ($row = MysqLi_fetch_array($query)) $id = $row["pid"]; $title = $row["ptitle"]; $area = $row["parea"]; $city = $row["pcity"]; $Displayproperty .= '<table width="500" border="0" cellspacing="0" cellpadding="1"> <tr> <td>' . $id . '</td> <td>' . $title . '</td> <td>' . $area . '</td> <td>' . $city . '</td> <td><a href="forms.PHP?pid=' . $id . '">Upload images</a><br /></td> </tr> </table>';