CodeIgniter Forums
CI.1.7 - $db->from() with $db->get() - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: CI.1.7 - $db->from() with $db->get() (/showthread.php?tid=12692)



CI.1.7 - $db->from() with $db->get() - El Forum - 10-28-2008

[eluser]Josip Jelic[/eluser]
I dont'n know if this is bug or new feature...

In Database Acrive record class using both $db->from("news") and $db->get("news", 10, 0) results in database error which wasn't the case in 1.6. It produces SELECT * FROM news, news which results in MySQL error: #1066 - Not unique table/alias: 'news'.

Is this expected behavior?

Documentation says:
Note: As shown earlier, the FROM portion of your query can be specified in the $this->db->get() function, so use whichever method you prefer.



Cheers


CI.1.7 - $db->from() with $db->get() - El Forum - 10-28-2008

[eluser]dmiden[/eluser]
Why would you want to use both?
$this->db->get(“news”, 10, 0) is enough?


CI.1.7 - $db->from() with $db->get() - El Forum - 10-28-2008

[eluser]Josip Jelic[/eluser]
I agree, but in previous versions it wasn't an issue. And I'm not talking only about 1.6.3. - I'm talking about 1.7.0. from SVN just days ago.

I'm only checking if this is intentional or not.

$db->from() is then pretty much useless when you have to define table in $db->get() anyway - but ok.

cheers!