[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
Void's Forums • View topic - php& mysql help

php& mysql help

Discuss Programming

php& mysql help

Postby byrdman » Wed Jan 12, 2011 5:15 pm

I have a quesiton.
I have a php page that strips out names and symbols from a stock feed we have. There are some stocks like "Macy's" and "McDonald's" that have the dreaded apostrophe, or single quote. When the name of that particular stock gets passed to the "$name" varible, it won't insert into mysql.
I saw posts to use mysql_real_escape_string, but that messes up names like Proctor & Gamble, with the ampersand in it. I also have tried the htmlspecialchars and htmlspecialchars_decode in php to no avail. Any pointers or links to help inserting an apostrophe into the mysql field?
byrdman
administrator
administrator
 
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Re: php& mysql help

Postby Void Main » Wed Jan 12, 2011 5:41 pm

mysql_real_escape_string() or addslashes()/stripslashes() are not working for you?
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Re: php& mysql help

Postby byrdman » Wed Jan 12, 2011 7:13 pm

byrdman
administrator
administrator
 
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Re: php& mysql help

Postby byrdman » Wed Jan 12, 2011 7:40 pm

byrdman
administrator
administrator
 
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Re: php& mysql help

Postby Void Main » Wed Jan 12, 2011 7:44 pm

User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA


Return to Programming

Who is online

Users browsing this forum: No registered users and 4 guests

cron