I've a php, which displays rows from a MySQL DB, sql query is like this
$cat = 'Available'
$sql = "SELECT title, location, date, matter, userName, emailId, phone FROM ad_usr WHERE type =".$cat;
query works fine in mysql.
but when try to execute following codes
$result = mysqli_query($link, $sql);
$row = mysqli_fetch_assoc($result);
gives an error like this
"mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given"
but when I use $cat serialNo instead of type and $cat as an integer then it works fine