[eluser]web-johnny[/eluser]
[quote author="Nadia Orin" date="1307802040"]I want to do this sql query
select table1.name, table1.address from table1 where table1.name = table2.name and table2.id = '12345';
I tried in my models with this syntax
$this->db->query("select.........");
but the result is error like this...
A Database Error Occurred
Error Number: 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 where table1.name = table2.name...
Anybody please help me... to do that sql query

(.. for my final assigment this semester... I'm gonna die

([/quote] Your query is wrong that's why . There is no such a table2!!!! perhaps you want to do a join. Read the active record it's quite easy.