Welcome Guest, Not a member yet? Register   Sign In
Can't perform a UNION ALL MySQL query
#3

[eluser]Ci beginner[/eluser]
[quote author="Colin Williams" date="1248684219"]You need to tell the DB class to not protect identifiers by supplying a third param of TRUE.

Code:
$this->db->where('UNION ALL "
        SELECT * FROM `blog` ORDER BY `id` DESC
        UNION ALL
        SELECT COUNT(*) FROM blog_comentarios, blog WHERE blog_comentarios.post_id = blog.id"', NULL, TRUE);
[/quote]

I can't try it now - I'm not @home. I trust you and it will probably works. Anyway, I don't fully understand why I need to use that. Would be nice if you can me a short explain about this, or if there's something about in the docs.

Thank you very much!


Messages In This Thread
Can't perform a UNION ALL MySQL query - by El Forum - 07-26-2009, 09:25 PM
Can't perform a UNION ALL MySQL query - by El Forum - 07-26-2009, 09:43 PM
Can't perform a UNION ALL MySQL query - by El Forum - 07-26-2009, 09:55 PM
Can't perform a UNION ALL MySQL query - by El Forum - 07-27-2009, 08:58 AM
Can't perform a UNION ALL MySQL query - by El Forum - 07-27-2009, 10:35 AM
Can't perform a UNION ALL MySQL query - by El Forum - 07-27-2009, 11:18 AM
Can't perform a UNION ALL MySQL query - by El Forum - 07-27-2009, 11:25 AM
Can't perform a UNION ALL MySQL query - by El Forum - 07-27-2009, 12:15 PM
Can't perform a UNION ALL MySQL query - by El Forum - 07-27-2009, 12:55 PM
Can't perform a UNION ALL MySQL query - by El Forum - 07-27-2009, 01:05 PM
Can't perform a UNION ALL MySQL query - by El Forum - 07-27-2009, 02:24 PM
Can't perform a UNION ALL MySQL query - by El Forum - 07-27-2009, 07:01 PM
Can't perform a UNION ALL MySQL query - by El Forum - 07-27-2009, 07:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB