I have two queries in php
, after using echo $id_inspirador
the value of the first query
is printed correctly, but I have an error regarding the second Notice: Undefined index: id_proyecto
, I do not know if the value of $id_inspirador
is lost when executing the second query.
$query = $con -> query ("SELECT id_inspirador FROM inspirador WHERE id_user = ".$id_user);
while ($fila = mysqli_fetch_assoc($query)) {
$id_inspirador = $fila['id_inspirador'];
}
$busqueda = $con -> query ("SELECT MAX(id_proyecto) FROM proyectos WHERE id_inspirador = ".$id_inspirador);
while ($fila_busqueda = mysqli_fetch_assoc($busqueda)) {
$id_proyecto = $fila_busqueda['id_proyecto'];
}