I execute several queries before querying the result in codeigniter:
$sql_drop_temptable = "...blabla..."; $sql_prepare = "it creates a temporary table; where I sum up later..."; $sql_summe = " select sec_to_time(sum(time_to_sec(summands))) from workday;"; $query = $this->db->query($sql_drop_temptable); $query = $this->db->query($sql_prepare); $query = $this->db->query($sql_summe)->row(); var_dump($query);
How can I avoid getting the last sql statement ($ sql_summe) as a keyword in the result set? Itβs hard for me to get the result in a scalar. The result is as follows:
object(stdClass)[41] public 'sec_to_time(sum(time_to_sec(summands)))' => string '00:23:54' (length=8)
I usually see column names as key values. But there is no column name in this because of the sum function, so it uses the sql operator as the key value. (?)
Thanks.
source share