Welcome to WebmasterWorld Guest from 54.159.50.111

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

problem with ip address insertion

mysql problem

     
8:43 pm on Feb 13, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:June 14, 2003
posts:42
votes: 0


This problem is manifesting it self outside PHP at the level of directly typing commands into the MYSQL application itself. Obviously it is going to have the same effect inside PHP. I need escape characters or something but nothing I have tried works.

typing the command
INSERT INTO table(ip,commentfield)VALUES ("111.222.333", 'old spammer
');

results in only the characters 111 appearing in the ip field . It is defined as a char 16 field.

[edited by: jatar_k at 8:52 pm (utc) on Feb. 13, 2004]
[edit reason] generalized [/edit]

8:51 pm on Feb 13, 2004 (gmt 0)

Administrator

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
posts:15755
votes: 0


what about single quotes

INSERT INTO table(ip,commentfield)VALUES ('111.222.333', 'old spammer');

8:42 am on Feb 14, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:June 14, 2003
posts:42
votes: 0


I tried that first of all. It has the same effect.
11:52 am on Feb 14, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Aug 21, 2003
posts:1069
votes: 0


I use a varchar(15) and insert with quotes and have no problems. Try that.

JAG