I am trying to use a variable that I have brought with $_REQUEST[]
and then in a condition where I say that if the method was POST, I execute a query in which I use that variable but it does not take it correctly.
This is the code, the variable that I need to use is $fad_id
and can be used in the query:
$fad_id = $_REQUEST['fad_id']; <br>
$modo = $_REQUEST['modo'];
if ($_SERVER[REQUEST_METHOD] == "POST")
{
$sql = "SELECT fat_id FROM fat_mstr WHERE fad_id = $fad_id";
$db->ejecutar($sql);
while ($val=$db->traer_datos_num()) {
$fat_id=$val[0];
}
var_dump($fat_id);
?>