MySQL Forums
Forum List  »  PHP

Re: Query with PHP variables not returning correct result.
Posted by: Richard Dunne
Date: March 21, 2015 03:16PM

I was assuming that real_escape_string() got rid of all unnecessary characters from $_GET, it didn't. When I echoed $Email after apply real_escape_string, I got
\'.email_address.\' when I was expecting just email_address Peter told me to turn magic_quotes off, but this feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0., I'm using 5.5.12 in WAMP After reading up on str_replace I added $Email = str_replace(".\'", "", $Email); $Email = str_replace("\'.", '', $Email); Query now works. If anyone has a cleaner solution please advise. Thanks.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.