<?php function add_visit($profile, $user) { $this->user__i = $user; $this->visitors = $this->row('SELECT `visitors` FROM `users` WHERE `id` = "'.$profile.'"'); $i2 = 0; for($i=0;$i<$this->new_id;$i++) { if($this->user__i != $this->visitors[$i]) { $i2++; } } if($i2 == $this->new_id) { $this->visitors[] = $this->user__i; mysql_query('UPDATE `users` SET `visitors` = "'.$this->new_visitors.'" WHERE `id` = "'.$profile.'"') or die(mysql_error()); } } ?>
Wszystko działa ok. (Kod trochę sieczka

Chciałbym coś trochę innego . tzn. max 10 elementów.
Jeśli osiągnie liczbę 10 elementów, to wszystkie elementy -1 (indeks.) i pozycja 1 w indeksie ma zostać usunięta. A na pozycję 10 ma się pojawić nowy element

Nie wiem czy jasno napisałem ;P