Welcome Guest, Not a member yet? Register   Sign In
Join on Table Named with Dash Produces 1054 Error
#4

[eluser]CroNiX[/eluser]
It's generally not a good idea to use dashes in db/table/field names as mysql thinks you're doing subtraction, just like it's not a good idea to use MySQL reserved words as names for identifiers. The escaping logic for your edge case obvious doesn't exist in the Active Record, so you'll probably need to use db::query() and write your own query, escaping your dashed column names. I'd use underscores instead of dashes so it's clear that subtraction operations are totally separate from names.


Messages In This Thread
Join on Table Named with Dash Produces 1054 Error - by El Forum - 04-04-2010, 09:03 AM
Join on Table Named with Dash Produces 1054 Error - by El Forum - 04-04-2010, 05:22 PM
Join on Table Named with Dash Produces 1054 Error - by El Forum - 09-22-2014, 10:26 AM
Join on Table Named with Dash Produces 1054 Error - by El Forum - 09-22-2014, 10:36 AM
Join on Table Named with Dash Produces 1054 Error - by El Forum - 09-24-2014, 02:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB