Jump to content

Archived

This topic is now archived and is closed to further replies.

corillo181

scaping single quote

Recommended Posts

It depends on what you want to do with the string. There's the function [a href=\"http://www.php.net/addslashes\" target=\"_blank\"]addslashes()[/a] that's good for most purposes. If you're going to be insterting the data into a mysql database, you should use the [a href=\"http://www.php.net/mysql_real_escape_string\" target=\"_blank\"]mysql_real_escape_string()[/a] function.

Ken

Share this post


Link to post
Share on other sites
yeah becuase i ot a for for users to fill it up and some times they add some thing like i'm this.. and the quote kills the query so i should add the real scape strign on every variable that is going into mysql?

Share this post


Link to post
Share on other sites
ye sit worked life saver :)

one mroe thing ken..

i got a lost password scrip but whe the person enters the email that they got in the database.. mysql has problems reading the @ sign.. show as a syntax error.. error in '@whatever.com in my scrip i just passthe email as a variable..

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.