It's probably the JavaScript call that's caching the response. Look into that.
if i using ->remember(1) i get some error : "syntax error, unexpected '->' (T_OBJECT_OPERATOR)"
this shows my query with remember function : " DB::select('SELECT cont_timestamp FROM Table WHERE id = ?', array($ID_USER)->remember(10));"
also i thought this is only for the query builder?
If i using -> " DB::select('SELECT cont_timestamp FROM Table WHERE id = ?', array($ID_USER))->remember(1);" - the application wont start to work.
Also in the JS Console is an error now :
" Uncaught SyntaxError: Unexpected token < "
Edit:
here the JS and PHP :
varmyVar=setInterval(function()
{
<?php
functionholeerstenstamp($ID_USER)
{
$result = DB::select('SELECT save_timstamp FROM table WHERE id = ?', array($ID_USER));
$ausgabe2 = $result[0]->save_timstamp;
echo ('JS: console.log("Save_timestamp 1");');
echo ('JS: console.log("'.$ausgabe2.'");');
return ($ausgabe2);
}
functionholeid()
{
$urlabhol = $_SERVER['REQUEST_URI'];
$id_user = substr($urlabhol, 1);
return ($id_user);
}
$timestamp1 = 0;
echo ('JS: console.log("Stamp1-0'.$timestamp1.'");');
$user_id = holeid();
$timestamp1 = holeerstenstamp($user_id);
?>
},20000);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community