【发布时间】:2014-01-02 08:46:51
【问题描述】:
我的程序出现以下错误
警告:mysql_fetch_assoc() 期望参数 1 是资源,布尔值在第 5 行的 C:\Users\joshi\Documents\EasyPHP-12.1\www\a.php 中给出
代码如下:
$con = mysqli_connect("localhost","root","","search");
$str = "Akshat";
$result = mysqli_query($con,"SELECT * from index WHERE name LIKE '%$str%'");
while($row = mysql_fetch_assoc($result))
{
echo "Name: " . $row["name"];
echo "<br>Desc: " . $row["desc"];
}
【问题讨论】: