I'm having a problem in adding another data inside a array I really don't know on how to pass it on. Here is my code.
if($q->num_rows() > 0){
foreach($q->result() as $rows){
$data[] = $rows;
}
$data[]['in'] = 'IN';
}
How can I add IN
inside the array. Because it gives me this.
[0] => stdClass Object
(
[rstatus] => Unavailable
[rprice] => 5000
)
[1] => IN
)
I want it to be like.
[0] => stdClass Object
(
[rstatus] => Unavailable
[rprice] => 5000
[in] => IN
)