PHP get value from sql query (use implode/explode?)
<p>I am running the below query. I can use the <code>ticket_cost</code> result column, but I'm having a hard time understanding how to pull the other data from the result. </p>

<pre><code>$sql = "SELECT ticket_cost, GROUP_CONCAT(game ORDER BY game DESC SEPARATOR '|') FROM games WHERE id IN (" . implode(',', $myIDArray) . ") GROUP BY ticket_cost ORDER BY ticket_cost DESC";
$myresult = mysqli_query($connection,$sql);
</code></pre>

<p>Result looks something like this in phpmyadmin:<br></p>

<pre><code>ticket_cost   |   GROUP_CONCAT(game ORDER BY game DESC SEPARATOR '|')
    10            thisIsATest|thisIsATest2|thisIsATest3
    5             thisIsAnotherTest
</code></pre>

<p>To display, I'm using:</p>

<pre><code>echo "&lt;ul&gt;";
foreach($myresult as $row2)
    {
        echo "This doesn't work:" . $row2['game'];
        echo "&lt;li&gt;" . $row2['ticket_cost'] . "&lt;/li&gt;";
    }
echo "&lt;/ul&gt;";
</code></pre>

<p>This displays:<br>
This doesn't work:<br>
10<br>
5</p>

<p>How can I display each of the pipe ("|") separated result items after each respective <code>ticket_cost</code>?</p>