Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache class not work in php loops #15

Open
ericfavoni opened this issue Sep 12, 2014 · 2 comments
Open

cache class not work in php loops #15

ericfavoni opened this issue Sep 12, 2014 · 2 comments

Comments

@ericfavoni
Copy link

I Put cache class into foreach loops but cache class only add/set one data into cache file.
code:

foreach($_POST['audio'] as $audio){
SQL::put("INSERT INTO " . NEWS_FILES . " (news_id, url, type) VALUES (?, ?, ?)", $id, $audio,"audio");
$c->store($id, array(
'action' => array(
$id, $video,"audio")
));
}
cache File:

{"202":{"time":1410452801,"expire":0,"data":{"action":[202,"http://localhost/user/uploads/files/1/thumbs/1/audio/download-kid-photo-c.jpg","audio"]}}}

I have 4 files for id 202 But cache class insert only one files in file. how to fix this?

@bencagri
Copy link

instead of caching data while writing, you should check if data is cached while reading. if cached, read from cache else make query and set cache.

@mariommoreno
Copy link

I have a similar problem. Only the first value is stored. It happens in a AWS instance, but not in my XAMPP. I can clear the cache and write again, but only ONE value.

Any Idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants