I am trying to store a subquery in a variable and then enter it in another query. The code I have is this:
$anu = "(SELECT DISTINCT Prod_Anun FROM productos where Prod_Anun = 'Particular')";
$consulta="SELECT *
FROM productos
WHERE Prod_Tit LIKE '%$bus%'
AND Prod_Anun = '$anu'";
Next I make the connection with the BDD and the whole process of showing the data by screen which does not work because I suppose that the method of passing the subquery is incorrect.
Thanks in advance