Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Bug Reports » Backslash adding in CONCAT in calculated field
Backslash adding in CONCAT in calculated field [message #1482] Tue, 15 July 2008 16:56 Go to next message
bonzo_bcn is currently offline  bonzo_bcn
Messages: 152
Registered: June 2008
Senior Member
I defined this calculated field in a relationship:

CONCAT_WS(',',participante.catsalut, participante.nombre, participante.apellido1,participante.apellido2) AS part_det

when I saved it it was automatically transformed to:
CONCAT_WS(\',\',participante.catsalut, participante.nombre, participante.apellido1,participante.apellido2) AS part_det


So when running the application I got this error:
Fatal Error: MySQL error: 1064 - 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 '\',\',participante.catsalut, participante.nombre, participante.apellido1,partici' at line 1 (# 1064).

SQL query: SELECT SQL_CALC_FOUND_ROWS equipo.equipo_id, participante.participante_id, CONCAT_WS(\',\',participante.catsalut, participante.nombre, participante.apellido1,participante.apellido2) AS part_det, 
Re: Backslash adding in CONCAT in calculated field [message #1485 is a reply to message #1482] Tue, 15 July 2008 20:17 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
I have tried this on my system and I cannot get it to fail. When I use a CONCAT expression in a relationship the single quotes are not escaped on the screen. You can see for yourself in the demonstration system by going to Home->Dictionary->Databases, select 'Xample', press 'Tables', select 'x_person', press 'Relationships (table)' followed by 'select all' and 'Read'.

Each single quote is escaped just once when it is exported to the <table>.dict.inc file, so the resulting sql satement is perfectly valid.

I assume you are using the latest version of Radicore?


Re: Backslash adding in CONCAT in calculated field [message #1704 is a reply to message #1482] Wed, 24 September 2008 10:32 Go to previous messageGo to next message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
bonzo_bcn,

Did you resolve this as I have exactly the same problem when creating a CONCAT in a relationship?

I am currently manually editing the dict file after exporting to correct this.
Re: Backslash adding in CONCAT in calculated field [message #1705 is a reply to message #1482] Wed, 24 September 2008 10:35 Go to previous messageGo to next message
bonzo_bcn is currently offline  bonzo_bcn
Messages: 152
Registered: June 2008
Senior Member
No I didn't. I only used those backslashes in two record so I didn't look further, but I'm sure it has something to do with mysql configuration.
Re: Backslash adding in CONCAT in calculated field [message #1709 is a reply to message #1704] Wed, 24 September 2008 11:30 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
Have you got magic quotes turned ON in your PHP configuration? This should be turned OFF in the htaccess file.

When you define the CONCAT statement in the relationship details are you including a backslash in front of each single quote? If so then you should not as the quotes will be escaped in the framework code.


Re: Backslash adding in CONCAT in calculated field [message #1712 is a reply to message #1482] Wed, 24 September 2008 11:56 Go to previous message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
Thanks for that - resolved!
Previous Topic: Error after upgrade to 1.37
Next Topic: Error with date in dd/mm/yyy format
Goto Forum:
  


Current Time: Thu Nov 28 23:00:30 EST 2024

Total time taken to generate the page: 0.01207 seconds