Problem with escape characters in results

Codes here !

Moderators: macek, egami, gesf

Steve_Dean
New php-forum User
New php-forum User
Posts: 2
Joined: Tue Mar 18, 2003 4:39 pm

Problem with escape characters in results

Postby Steve_Dean » Tue Mar 18, 2003 4:48 pm

I am getting inconsistent result from a query that has results with a single quote or an apostrophe in the data. Some times the results show escape characters, and sometimes it doesn’t. Any idea of what could cause such a thing? :? :?:

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Postby Redcircle » Tue Mar 18, 2003 9:44 pm

use addslashes() around the variable. this will add the appropriate slashes so it won't do funky stuff.

Steve_Dean
New php-forum User
New php-forum User
Posts: 2
Joined: Tue Mar 18, 2003 4:39 pm

mysql_escape_string() is working well

Postby Steve_Dean » Tue Mar 18, 2003 10:24 pm

The mysql_escape_string() appears to work well. The server i am on has some mixed up magic_quotes settings that mess with the functionality of addslashes and stripslashes. 8O They only work when they 'want\' to on that server.

Thanks for the input.


Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 3 guests

cron