Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/20/2023 in all areas

  1. Hi looking for some help with below issue I'm facing, any help would be great I have an SQL table call Merge with the below data in Id StoreId Description 1 B013 Alana 2 B013 Sleepmotion 3 B013 Sleepmotion 4 B013 Sleepmotion 5 B013 Hyde & Sleep 6 B017 Alana 7 B017 Isabella 8 B017 Sleepmotion 9 B017 Sleepmotion 10 B017 Sleepmotion 11 B017 Hyde & Sleep I'm trying to get the data to display as a table with description concatenated as below B013 Alana Sleepmotion Sleepmotion Sleepmotion Hyde & Sleep B017 Alana Isabella Sleepmotion Sleepmotion Sleepmotion Hyde & Sleep
    1 point
  2. Works OK for me, but try putting $data = []; at start of the code.
    1 point
  3. try $res = $pdo->query("SELECT storeid , description FROM merge ORDER BY storeid "); foreach ($res as $r) { $data[$r['storeid']][] = $r['description']; } echo "<table>\n"; foreach ($data as $store =>$prods) { echo "<tr style='vertical-align: top;'><td>$store</td><td>" . join('<br>', $prods) . "</td></tr>\n"; } echo "</table>\n";
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.