Editor - DB field names with embedded spaces
Editor - DB field names with embedded spaces
I just downloaded the Editor trial version and built some pages with editable datatables for several tables in an existing MySql database. All looked good till I got to a table which has a column name with embedded spaces. The resulting page fails to retrieve the requested table data with a MySql syntax error near the select list. I used backtick quotes on all occurrences of the subject field name in the client and server ajax scripts and tried again with the same result. Am I doing something wrong or am I trying to do something that is not permitted?
This discussion has been closed.
Replies
[code]
if ( strpos($identifier, ' as ') !== false ) {
$alias = strstr($identifier, ' as ');
$identifier = substr($identifier, 0, - strlen($alias));
}
[/code]
should be:
[code]
if ( strpos($identifier, ' ') !== false ) {
$alias = strstr($identifier, ' ');
$identifier = substr($identifier, 0, - strlen($alias));
}
[/code]
Then you'll be able to do things like:
[code]
Field::inst( 'eng ine', 'engine' )->validator( 'Validate::required' ),
[/code]
I'll package this up into the next release. Thanks for flagging it up.
Regards,
Allan