Hi Guys,
I have a sql query that is not working when I enter a value with single quotes. The query is listed bellow:
$sql_check = "SELECT * FROM venue WHERE name = '$restaurant_name' AND address = '$address' AND city = '$city' AND country = '$country' AND postcode LIKE '%$postcode%'";
SELECT * FROM venue WHERE name = 'Inn The Park Restaurant' AND address LIKE '%St James's Park, Westminster%' AND city = 'London' AND country = 'United Kingdom' AND postcode LIKE '%W86TA%'
I carry out the following functions on the user input:
$address = $_POST['address'];
$address = filter_var($address, FILTER_SANITIZE_STRIPPED);
$address = mysql_real_escape_string($address);
Any help why I get an error or any other function I need to run on the user input?
Cheers - Zahid