Qoute safe

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mzfp2
Forum Contributor
Posts: 137
Joined: Mon Nov 11, 2002 9:44 am
Location: UK
Contact:

Qoute safe

Post by mzfp2 »

Just downloaded a dump file from my database server provider, and tried running it on my own MYSQL server, howeer i realised some inserts failed because of qoutes.

What is the safe way to add strings to a database, regardless of the qoutes that may or may not appear in the string?
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Can you escape text in the web database and THEN create a dump file?
mzfp2
Forum Contributor
Posts: 137
Joined: Mon Nov 11, 2002 9:44 am
Location: UK
Contact:

Post by mzfp2 »

Not quite sure what you mean by escaping text :oops:
lcidw
Forum Commoner
Posts: 58
Joined: Mon Apr 28, 2003 8:55 am
Location: Netherlands

Post by lcidw »

An scape character is for example a backslash in front of another character to make sure it's not implemented wrong i believe. Have a look at stripslashes() or quotemeta()
Post Reply