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

[eluser]wallace[/eluser]
Hi,

I have the same problem with the latest version of CI but for the columns names.

Code:
$this->db
                    ->from('fqdn_has_ipaddress AS r')
                    ->join('fqdn AS f', 'f.fqdn-id = r.fqdn-id', 'inner')
                    ->join('ipaddress AS i', 'i.ipaddress-id = r.ipaddress-id', 'inner')
                    ->where('f.fqdn-id', $fqdnid)
                    ->get()->result();

SELECT * FROM (`fqdn_has_ipaddress` AS r) INNER JOIN `fqdn` AS f ON `f`.`fqdn`-`id` = r.fqdn-id INNER JOIN `ipaddress` AS i ON `i`.`ipaddress`-`id` = r.ipaddress-id WHERE `f`.`fqdn-id` = '2'

Left condition is sql quoted arround dash and in right condition there is no sql quotes.
It's a bug or I don't make good syntax query?

Thanks


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