PHP -Warning: mysqli_fetch_array() -
php code:
<?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 connect mysql: " . mysqli_connect_error(); } $res = mysqli_query($con,"select * __scannedfiles description '%$desc%' , title='$name' , doctype='$type' "); while($row = mysqli_fetch_array($res)){ $path=$row[3]; echo '<a target=\"_blank\" href="'.$path.'" title=\"\">'.$path.'</a> '; } ?>
error:
warning: mysqli_error() expects 1 parameter, 0 given. error.
it means query giving error, use mysqli_error()
viewing error in query
$res = mysqli_query($con,"select * __scannedfiles description '%$desc%' , title='$name' , doctype='$type' ") or die(mysqli_error());
Comments
Post a Comment