I have to create a PHP function to list the matching records by the ID_EMPLEATE field, between 2 tables.
Table 1 is from Oracle, and I only have access to consult it, it is made up of all the employees that enter or are present, it is filled and emptied alone in real time, I can only access it through a query that was passed to me.
Table 2 I did in Mysql, I have full access to modify and delete, and there I have all employees loaded, but only 2 fields ID_EMPLEADO and "Avisar", the latter by default with zero value. The idea would be to be able to mark (value 1 in the Notify field) the employees that I want to know who entered.
I need to compare both tables, every 2 minutes, and show a warning on the screen when any ID in table 2 with the alert field in 1, appears active in Table 1 (table where only those that entered). Below I copy how I get the records from table 1 (Oracle) from my php.
<?php
function empleados_actuales($conn)
{
$stid = oci_parse($conn, "SELECT ID_EMPLEADO FROM TABLE(Ver_Empleados.Obtener_empleados()) ORDER BY ID_EMPLEADO");
if (!$stid) {
$e = oci_error($conn);
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
$r = oci_execute($stid);
if (!$r) {
$e = oci_error($stid);
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
return $stid;
}
?>
I am not very advanced in PHP but I am trying to learn, I do not know how to compare data from an Oracle query, with data from a query in Mysql. Could you help me put together how to do it, even if it's basically?