Can anybody see how i can use a String instead of Numeral for this Statement,
Im trying to pull all rows with $delivery when $delivery="ALL" but i can only pull 1 single Variable, if i want to pull an array, i cannot , because i get Array conversion num to string,
$delivery_con = [];
if ($delivery==="collection") { $delivery_con[]="no";}
if ($delivery==="delivery") {$delivery_con[]="yes";}
if ($delivery==="local") {$delivery_con[]="yes local";}
if ($delivery==="either") {$delivery_con=["no","yes","yes local"];}
$query="SELECT *
FROM testdata
WHERE title LIKE ?
AND location LIKE ?
AND postcode LIKE ?
AND price >=?
AND price <=?
AND cond=?
AND catagory LIKE ?
AND delivery IN ?
ORDER BY $order $dir";
$stat=$db->prepare($query);
$stat->execute(array("%$searchfor%",
"%$location%",
"%$postcode%",
"$pricefrom",
"$priceto",
"$cond",
"%$catagory%",
"$delivery_con"));
So my question is, how can a get around this for the select function to work with $variables,
Im really stuck. If anybody can help
Thank you.