I would like to be able to do something like this:
foreach($items as $row) {
$data = array(
name = $row->name,
item = "SELECT section from articles WHERE user_id = 2 LIMIT 1"
);
}
now my articles table looks like this:
id user_id section
=============================
1 2 XYZTRWE
2 2 GWERSTI
3 2 QRTPSLG
The problem is that always very first record from articles gets picked up.
What I would like for example, if I have 2 records in $items array, $data['item'] values should be XYZTRWE and GWERSTI, but I always end up with XYZTRWE for all values.