Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Funkcja pobierająca ip
primo
post
Post #1





Grupa: Zarejestrowani
Postów: 254
Pomógł: 0
Dołączył: 30.12.2003
Skąd: Strzegom

Ostrzeżenie: (0%)
-----


Hejka,


Czy funkcja Remote ADDR w poniższym przykładzie może być zapisana w inny sposób (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) ::

  1. <?php
  2. function update() {
  3.  global $REMOTE_ADDR;
  4. mysql_db_query($this->database,"INSERT INTO ".$this->table." VALUES (NOW(),INET_ATON('".$REMOTE_ADDR."'))") or die("Write Error<br>".mysql_error());  
  5. mysql_db_query($this->database, 
  6. "DELETE FROM ".$this->table." WHERE time < DATE_SUB(NOW(), INTERVAL $this->sec SECOND)") or die("Delete Error<br>".mysql_error());
  7.  
  8. $result = mysql_db_query($this->database,"SELECT count(DISTINCT ip) as total FROM ".$this->table) or die("Read Error<br>".mysql_error());
  9. $trows = mysql_fetch_array($result);
  10. $this->TotalUserNum = $trows[total]; 
  11.  
  12. $result = mysql_db_query($this->database,"SELECT count(ip) as total FROM ".$this->table) or die("Read Error<br>".mysql_error());
  13. $trows = mysql_fetch_array($result);
  14. $this->TotalHits = $trows[total];
  15. }
  16. ?>


Na stronie mi wywala:
Write Error
Column 'ip' cannot be null -- pomimo, że próbuję manipulować tabelą na wszystkie sposoby.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 4.10.2025 - 18:14