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