I'm using mysqli_query()
with a dynamic variable $categoryName
, where $categoryName
will be dynamic where the category name will be fetch based on user submission from a form.
Within my category name submission form there are Food, Vintage clothing, Leisure, Angel's
etc...
I'm still quite new to querying content from database, currently managed to come out with using mysqli_query()
for querying from the database, like so:
$sqlCommand = mysqli_query($conn, "SELECT * FROM products WHERE category='$categoryName'");
Everything works great and I managed to query the db with my existing category names, however there's only one which doesn't work is the Angel's
category with '
apostrophe symbol in it.
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in.......
I suspect there is some sort of method like filter that need to be called before mysqli_query()
?