Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
  #1  
Old 6th June 2021, 19:50
szaby's Avatar
szaby szaby is offline
Senior Member
 
Join Date: Jul 2008
Posts: 19
Default Memcache problem... or php code?
Hello!

I attached a picture. My ID is the number 5. Why does memcache delete data from memory?

Click the image to open in full size.

PHP Code:
if (($user $mc1->get_value('user' $id)) === false
{
  
$user_fields_ar_float = array('u.time_offset','u.total_donated');

  
$user_fields_ar_int = array('u.id','u.class','u.torrentsperpage','u.invites','u.invited_by','u.topicsperpage','u.postsperpage','u.last_browse','u.advent','u.login','u.added','u.last_login',
                              
'u.last_access','u.warneduntil','u.leechwarnuntil','u.vip_until','u.free_until','u.dst_in_use','u.auto_correct_dst','u.donoruntil','u.donated','u.faq_readed',

                              
'count(DISTINCT comm.id) AS comments',
                              
'count(DISTINCT posts.id) AS forumpost',                        
                                  
                              
'u.uploaded','u.downloaded','u.seedbonus');

  
$user_fields_ar_str = array('u.username','u.passhash','u.secret','u.editsecret','u.email','u.status','u.privacy','u.theme','u.acceptpms','u.ip','u.avatar','u.notifs','u.enabled','u.avatars','u.donor',
                              
'u.warned','u.deletepms','u.savepms','u.passkey','u.uploadpos','u.downloadpos','u.leechwarn','u.chatpost','u.pincode','u.forumpost','u.vip_added','u.cpanel','u.invisible',
                              
'u.highspeed','u.adult','u.observed','u.observed_reason','u.checked_user','u.free','u.disabled_reason',
                                  
                              
'u.modcomment','u.bonuscomment');
    
  
$user_fields implode(', 'array_merge($user_fields_ar_int$user_fields_ar_float$user_fields_ar_str));  
  
  
$r sql_query("SELECT $user_fields FROM users u 
                  LEFT JOIN comments comm ON (u.id = comm.user) 
                  LEFT JOIN posts ON (u.id = posts.userid) 
                  LEFT JOIN peers p ON (u.id = p.userid) 
                  WHERE u.id = "
.sqlesc($id)) OR sqlerr(__FILE____LINE__);
                  
  
$user mysqli_fetch_assoc($r) OR stderr("Hiba""Nincs felhasználó a megadott ID-vel.""danger");

  foreach (
$user_fields_ar_int as $i$user[$i] = (int)$user[$i];
  foreach (
$user_fields_ar_float as $i$user[$i] = (float)$user[$i];
  foreach (
$user_fields_ar_str as $i$user[$i] = $user[$i];
  
$mc1->cache_value('user' $id$user$INSTALLER09['expires']['user_cache']);

A $INSTALLER09['expires']['user_cache'] is set in the config file.

When it expires in 30 days ... It's in it first. No more for next search.

Thank You!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 01:16. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2021, vBulletin Solutions Inc.