Author Topic: Apostrophes don't work in entry names  (Read 43 times)

flava

  • Newbie
  • *
  • Posts: 4
    • View Profile
Apostrophes don't work in entry names
« on: March 15, 2021, 03:53:57 pm »
Long time admin of the software here.  Every year, I have to instruct people not to use apostrophes in their entry names or the MySQL database will give an error.  Does anyone have a workaround for this?

Here's the error:
Failed to write entry to database.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's test','PLAYERID=dean's test,PLAYERINFO1=xxxxxxxxx,PLAYERINFO2=,PLAYERINFO3=de' at line 1Content-type: text/html

Share on Facebook Share on Twitter


Doug

  • Administrator
  • Hero Member
  • *****
  • Posts: 3795
    • View Profile
    • Turbo Tourney
Re: Apostrophes don't work in entry names
« Reply #1 on: March 15, 2021, 04:14:48 pm »
I would think you could use the MySQL character replacement to get this to work.  If you go to the Database Connector screen and click on the DB Scripts button to open the scripts folder there is a file called AccessReplaceChars.txt that can be used for special character handling in mySQL.  Maybe if you replace ' with '' that might work?

########################################################################
##   SPECIAL MYSQL CHARACTER HANDLING                                                                   
########################################################################
##  Add any special characters here that you would you like to be   
##  replaced before being used in any SQL functions.  Some examples:
##
##  \b  A backspace character.   chr(8)
##  \n  A newline (linefeed) character.  chr(10)
##  \r  A carriage return character.  chr(13)
##  \t  A tab character.  chr(9)
##  \Z  ASCII 26 (Control-Z). See note following the table.  chr(26)
##  \\  A backslash (\) character.
##  \%  A % character. See note following the table.
##  \_  A _ character. See note following the table.
##                 
##  Format should be [charactertoreplace]:[replacewith]
##
##  Ex:   \:\\ will replace a \ with \\
##
##  For special nonprintable characters use the Chr(##) to replace them
##
########################################################################

## Examples
##\:\\
##Chr(34):\Chr(34)
##Chr(0):\0
##':\'

flava

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Apostrophes don't work in entry names
« Reply #2 on: March 15, 2021, 04:21:55 pm »
Thanks, will try that!