Support the ongoing development of Laravel.io →
Requests Cache Database
Last updated 9 months ago.
0

maybe you should use ->remember(minute)

Last updated 9 months ago.
0

It's probably the JavaScript call that's caching the response. Look into that.

Last updated 9 months ago.
0

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);
Last updated 9 months ago.
0

Sign in to participate in this thread!

Full Stack Europe

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2023 Laravel.io - All rights reserved.