Welcome Guest, Not a member yet? Register   Sign In
active record : SELECT [...] FROM (SELECT [...]) ?
#1

[eluser]m_ologin[/eluser]
Hi community,

How can I create the active record query for this :
Code:
SELECT sum(s1) AS max_pts FROM (SELECT max(a.nb_points) AS s1 FROM t_ans a LEFT JOIN t_qu q ON a.id_qu = q.id WHERE a.is_correct=1 GROUP BY a.id_question) AS st1
#2

[eluser]TheFuzzy0ne[/eluser]
I'm not sure if you can to be honest...
#3

[eluser]m_ologin[/eluser]
Ok so do I need to sanitize my data before and just do a simple query?
#4

[eluser]TheFuzzy0ne[/eluser]
I would say so, yes. Don't forget to use $this->db->escape(); Smile
#5

[eluser]m_ologin[/eluser]
Allright. Thanks for your help.




Theme © iAndrew 2016 - Forum software by © MyBB