Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> jak to przerobić na normalny IP - `ipaddr` int(16)
Elber
post
Post #1





Grupa: Zarejestrowani
Postów: 381
Pomógł: 12
Dołączył: 9.07.2007

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


Witam, mam taki problem, postawiłem sobie LMS, i wszystko dobrze działa (IMG:http://forum.php.pl/style_emoticons/default/haha.gif) Ale w bazie zamiast IP, które dodaje czyli 192.168.0.1 jest coś takiego 3232237834 i chciałem sie zapytać jak to działa (IMG:http://forum.php.pl/style_emoticons/default/haha.gif) Jak to sie potem zamienia spowrotem w normalne IP (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

Tak wygląda struktura tabeli:
Kod
CREATE TABLE `nodes` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(16) NOT NULL default '',
  `mac` varchar(20) NOT NULL default '',
  `ipaddr` int(16) unsigned NOT NULL default '0',
  `ipaddr_pub` int(16) unsigned NOT NULL default '0',
  `passwd` varchar(32) NOT NULL default '',
  `ownerid` int(11) NOT NULL default '0',
  `creationdate` int(11) NOT NULL default '0',
  `moddate` int(11) NOT NULL default '0',
  `creatorid` int(11) NOT NULL default '0',
  `modid` int(11) NOT NULL default '0',
  `netdev` int(11) NOT NULL default '0',
  `linktype` tinyint(1) NOT NULL default '0',
  `access` tinyint(1) NOT NULL default '1',
  `warning` tinyint(1) NOT NULL default '0',
  `lastonline` int(11) NOT NULL default '0',
  `info` text NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `name` (`name`),
  UNIQUE KEY `ipaddr` (`ipaddr`),
  KEY `netdev` (`netdev`)
) TYPE=MyISAM  AUTO_INCREMENT=1855;

A tak kawałek zrzutu:
Kod
INSERT INTO `nodes` (`id`, `name`, `mac`, `ipaddr`, `ipaddr_pub`, `passwd`, `ownerid`, `creationdate`, `moddate`, `creatorid`, `modid`, `netdev`, `linktype`, `access`, `warning`, `lastonline`, `info`) VALUES
(3, 'Test', '00:09:92:01:85:B2', 3232237834, 0, '', 0, 1161669555, 1161669577, 3, 3, 1, 0, 1, 0, 0, ''),


Ten post edytował Elber 1.02.2008, 09:45:21
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: 23.12.2025 - 18:04