Jump to content
php.lv forumi

skaititajs ar mysql..


edw

Recommended Posts

sveiciens visiem..

velejos pajautat varbut kadam ir aizkeries tads kods kas skaita cilvekus kas apmekle lapu, bet veletos lai ari visas ip tiktu saglabas mysql tabula + vel paraditos amekletaji sonien un vispar kopa....

;)

Link to comment
Share on other sites

Datumam erti vari izmanto MYSQL f-ju NOW(), savukart

IP pierakstam lietot INTEGER lauku ...

Lai bez problemaam to izmantotu ir 2 MYSQL f-jas kas ip parversh INTEGER un atpakal....

 

INET_ATON() IP ==> INT

INET_NTOA() INT ==> IP

piemeram ierakstot DB:

INSERT INTO tabulis  ( ip, datums ) VALUES (INET_ATON('255.255.255.255'), NOW() )

pie nolasishanas:

SELECT INET_NTOA(ip) AS ip_adrese , datums FROM tabulis

Parejos laukus tachu varesi pielikt?

IP adreses dabushanai $_SERVER['REMOTE_ADDR'].

P.S. protams to 255.255... vietaa usera IP.. ;)

Edited by Grey_Wolf
Link to comment
Share on other sites

×
×
  • Create New...