PHP代码:PHP - 警告:mysqli_fetch_array()
<?php
$name = $_GET['name'];
$type = $_GET['type'];
$desc = $_GET['desc'];
$con=mysqli_connect("localhost","root","","projdb");
// Check connection
if (mysqli_connect_errno($con))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$res = mysqli_query($con,"SELECT * FROM __scannedfiles WHERE description LIKE '%$desc%' AND title='$name' AND doctype='$type' ");
while($row = mysqli_fetch_array($res)){
$path=$row[3];
echo '<a target=\"_blank\" href="'.$path.'" title=\"\">'.$path.'</a> ';
}
?>
错误:
Warning: mysqli_error() expects exactly 1 parameter, 0 given. this is the error.
请仔细阅读本手册,该函数在不同情况下可能返回的内容。然后阅读如何获取数据库的错误消息。 – CBroe 2013-05-03 06:23:24
复制粘贴不起作用? – shapeshifter 2013-05-03 06:23:54
我猜__scannedfiles不存在,在任何情况下,运行查询返回false。请检查您的查询。 – 2013-05-03 06:36:05