View Single Post
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 06-21-2009 , 02:23   Re: SQL Error when name contains apostrophe
Reply With Quote #4

Quote:
Originally Posted by Mlk27 View Post
Oh..Is this corrent?

Code:
    get_user_name(id, name, 31)

    if(containi(name, "'"))
        replace_all(name, 31, "'", "\'")
You don't need that.

Just do:
Code:
SQL_PrepareQuery(SqlConnection, "INSERT INTO rm_rates VALUES(^"%s^",^"%s^")", steamid, name)
(Names can't have quotes so you would be fine and will not waste resources)
__________________

Last edited by joaquimandrade; 06-21-2009 at 20:46.
joaquimandrade is offline