Welcome to WebmasterWorld Guest from

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)

10+ Year Member

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)

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

what about single quotes

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


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

10+ Year Member

I tried that first of all. It has the same effect.


11:52 am on Feb 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

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



Featured Threads

Hot Threads This Week

Hot Threads This Month