Hello all,
I got added a JS function into a OnScriptInit section of a GRID .
The function foo() has to check if in mysql db a new record has been created. It runs every 2 seconds. It runs trigger_check_timestamp_tubes.php that is mainly a SELECT checking if a new record is present or not.
Everything works but now after some time (i.e. one day) I got this fatal error.
I suppose that there is something wrong on use of memory but I’m not able to understand what and where can “eat” memory till the error occurs.
Can someone help me ? Thanks
[24-Aug-2018 15:23:30 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 10489856 bytes) in Unknown on line 0
[24-Aug-2018 15:23:30 UTC] PHP Stack trace:
[24-Aug-2018 15:23:30 UTC] PHP 1. {main}() C:\wamp64\www\Eos_Tat_Meter\checkRecords rigger_check_timestamp_tubes.php:0
[24-Aug-2018 15:23:30 UTC] PHP 2. trigger_check_timestamp_tubes_apl->controle() C:\wamp64\www\Eos_Tat_Meter\checkRecords rigger_check_timestamp_tubes.php:1915
…
function foo()
{
$.ajax({
url: “…/checkRecords/trigger_check_timestamp_tubes.php”,
type:“POST”,
data: {id:1},
success: function(result){
//alert(result);
if(result != “”) window.location.href = “grid_tubes_labo_red.php?t=<? echo $timer_timer ?>”;
}});
}
========= This is the content of trigger_check_timestamp_tubes.php
$check_sql = “SELECT CONCAT( ‘A’ , COUNT(*)) FROM do_update
WHERE description
= ‘red_tubes’ AND updated
= 0”;
sc_lookup(rs, $check_sql);
$rs_val = {rs[0][0]} ;
//echo "RS " . $rs_val . “<br>” ;
if ({rs[0][0]} === false)
{
echo “Access error. Message=”. {my_data_erro} ;
}
elseif ({rs[0][0]}==‘A0’)
{
echo “”;
}
else
{
echo “NEW RECORD”;
}