Hi
I have a query which returns a series of cells of data from a $this->db->query($sql)
in the controller. What I want to do is foreach row of data, concatenate two of the cells and create a new cell then add it back to the array? For example, if i had an array:
A 1
B 2
C 3
Then we can after processing the array
A 1 A1
B 2 B2
C 3 C3
I was going to do it all in sql but I need a php function to do a urlencode. Initially I tried
for($i=0; $i < $listProducts->num_rows(); $i++){
$listProducts[$i][‘prodUrl’] = '/index.php/product/'.
urlencode($listProducts[$i]['ProductName']).
'/'.$listProducts[$i]['PK_Product'];
}
But then realised that the return from $this->db->query($sql)
isn't an associative array.
help?