|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Adding an IP
Heya, i'm trying to add IP's into a DB, although, it only ever adds the first set of number before the first decimal.. (ie. if IP is 202.45.75.312, it will only add 202)
any ideas on why this happens? i'm guessing the solution will have something to do with escaping the decimals, but i'm not sure |
|
#2
|
|||
|
|||
|
RE: Adding an IP
What type of field are you using? If ur using integer, it will obviously not include the entire thing.. Use varchar or tinytext (i'd use tinytext.. just matter of preference somehow)
The other option is to simply use the bitfields of the split ip address and put that into a integer field. ie : hehe, i was actually coding something that actually manipulates the bits.. and then i found the ip2long() and long2ip() functions |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Adding an IP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|