Hello everyone is a bit I understand the title sorry,
if what I want is to use a data I get from a query of a while while in another query I'm doing within the same php document
this is my while cycle
<?php
$_proceso = $_GET['var'];
$query = "SELECT id,Nombre_proceso FROM proceso WHERE Nombre_proceso = '$_proceso'";
$_result = $conn->query($query);
if (!$_result) die($conn->error);
while ($_row = mysqli_fetch_array($_result)){
$_proceso = $_row["Nombre_proceso"];
$_id = $_row["id"];
}
?>
This is the part where I want to use the ID data that comes out of the ascle while
<?php
$query = "SELECT riesgo,Criticidad,Ocurrencia,Reaccion,Valor,CASE
WHEN Decision = 0 THEN 'Eliminar'
WHEN Decision = 1 THEN 'Mitigar'
WHEN Decision = 2 THEN 'Delegar'
WHEN Decision = 3 THEN 'Aceptar'
END as Decision,Plan_Accion FROM riesgo_metodo_que where id_Proceso = ".$_id = row['id']." Order By Valor";
$result = $conn->query($query);
if (!$result) die($conn->error);
?>