goma smile Posted December 18, 2010 Report Share Posted December 18, 2010 Iekš db saglabā a:3:{i:1292632517;i:6;i:1292601400;i:5822;i:1292426585;i:2;} izvadot print_r(unserialize($user->last_visitors)); Array ( [1292632517] => 6 [1292601400] => 5822 [1292426585] => 2 ) Kā ds var pateikt kā var lai ir [0] => stdClass Object ( [time] =>1292632517 [user_id] =>6 ) [1] => stdClass Object ( [time] =>1292601400 [user_id] =>2 ) [2] => stdClass Object ( [time] =>1292426585 [user_id] =>5822 ) Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted December 18, 2010 Report Share Posted December 18, 2010 Kapēc ta tu nesaglabā uzreiz kā vajag? Lai no otrā dabūtu trešo: $oa = array(); foreach($a as $t => $uid) $oa[] = (object) array('time' => $t, 'user_id' => $uid); var_dump($oa); Quote Link to comment Share on other sites More sharing options...
goma smile Posted December 18, 2010 Author Report Share Posted December 18, 2010 (edited) Man sanāca $view = unserialize($user->last_visitors); foreach($view as $t => $uid){ echo $t; echo '<br />'; } Un kā var izvilkt piemēram lietotājvārdu no $uid Edited December 18, 2010 by goma smile Quote Link to comment Share on other sites More sharing options...
goma smile Posted December 19, 2010 Author Report Share Posted December 19, 2010 (edited) šita jau nav normāli ... ? $view = unserialize($user->last_visitors); foreach($view as $t => $uid){ $res = mysq_query('SELECT members_display_name FROM ibf_members WHERE id='.$uid); echo '<pre>'; print_r($viewer); } Edited December 19, 2010 by goma smile Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.