homepage Welcome to WebmasterWorld Guest from 54.242.231.109
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
problem with ip address insertion
mysql problem
neiljones




msg:1296209
 8:43 pm on Feb 13, 2004 (gmt 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]

 

jatar_k




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

what about single quotes

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

neiljones




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

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

justageek




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

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

JAG

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved