Welcome Guest, Not a member yet? Register   Sign In
Query Problem
#1

[eluser]tolgay[/eluser]
Hi

I am using this code
Code:
$this->db->select("*");
$this->db->from('arkadaslar');
$this->db->join('uyeler',"uyeler.id=(arkadaslar.uid+arkadaslar.fid)-2");
$this->db->get();

This is returning error

Quote: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 '' at line 3

SELECT *, `arkadaslar`.`uid` as i1, `arkadaslar`.`fid` as i2 FROM (`arkadaslar`) JOIN `uyeler` ON `uyeler`.`id`=(`i1+i2)`

But if I use this code

Code:
SELECT *FROM `arkadaslar` join uyeler on uyeler.id=(arkadaslar.uid+arkadaslar.fid)-2

This is working.Problem is the nails.How can I resolve this ?


Messages In This Thread
Query Problem - by El Forum - 06-27-2012, 02:08 AM
Query Problem - by El Forum - 06-27-2012, 02:30 AM
Query Problem - by El Forum - 06-27-2012, 03:19 AM
Query Problem - by El Forum - 06-27-2012, 03:43 AM
Query Problem - by El Forum - 06-27-2012, 04:09 AM
Query Problem - by El Forum - 06-27-2012, 07:21 AM
Query Problem - by El Forum - 06-27-2012, 08:28 AM
Query Problem - by El Forum - 06-27-2012, 09:10 AM
Query Problem - by El Forum - 06-27-2012, 09:28 AM
Query Problem - by El Forum - 06-27-2012, 09:48 AM
Query Problem - by El Forum - 06-27-2012, 10:34 AM
Query Problem - by El Forum - 06-27-2012, 10:47 AM
Query Problem - by El Forum - 06-27-2012, 10:55 AM
Query Problem - by El Forum - 06-27-2012, 11:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB