I have been trying to solve this problem for a few days now and can't seem to work it out. I'm sure i'm missing some simple point..
I am using a mysql PDO fetch to return 2 fields in each row and then put them into an array of their own:
foreach ($st->fetchAll() as $row){
$subs[] = array($row['subscriber'],$row['plant']);
Some of the rows share the same $row[0], which is the 'subscriber' field. What I want to do is make up another array with each smaller array having a single, unique $row[0] and any number of added 'plant' fields following (e.g $row[1],$row[2] etc).
I've tried all sorts of ways to achieve this but am at a loss. Would someone be able to point me in the right direction ? Thanks.