Welcome Guest, Not a member yet? Register   Sign In
Help with Mysql Query - Subindex_string + group_concat
#8

(This post was last modified: 05-06-2021, 10:44 PM by tektion.)

(05-06-2021, 12:24 PM)php_rocs Wrote: @tektion,

Have you tried the query by using the query binding method instead (https://codeigniter.com/user_guide/datab...y-bindings)?

Tyvm for the suggestion, seems like the best option for advanced queries indeed as it avoids the need of escaping characters-. 


Code:
$sql = "SELECT SUBSTRING_INDEX(GROUP_CONCAT(id separator ','), ',', 5) FROM `table`";

$this->QueryDb->query($sql);

This works but if possible I would still like to know the proper char escaping to make the query work with my Model, as I am working with arrays and using Models makes life easier .
Reply


Messages In This Thread
RE: Help with Mysql Query - Subindex_string + group_concat - by tektion - 05-06-2021, 09:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB