Can I store the result of a query in a variable and use the value in another query?
//consulta que quiero hacer primero
$consulta_pre_has = "SELECT
MAX(Prod_Pres)
FROM productos";
//hago la consulta
$pre_has=mysqli_query($conexion, $consulta_pre_has);
I use the variable $ pre_has that theoretically stores the value of the query in another query
SELECT
*
FROM
productos
WHERE
Prod_Pres
BETWEEN
0 AND '$pre_has'
The problem is that if I want to show the value of $ pre_has on the screen, it does not show me anything and therefore I understand that at the time of making the previous query the value of $ pre_has is null and that's why it does not work for me