Explode array and define Variables
<p>I have the following which returns </p>

<p>"soccertennisfootball"</p>

<pre><code>$interestsquery  = "SELECT * FROM user_interests WHERE user_id = " . $usersClass-&gt;userID();
$result = mysql_query($interestsquery);

while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "{$row['interest']}";
} 
</code></pre>

<p>Can somebody please explain how I can explode the data and assign it as variables? I've been looking around at tutorials but they all seem to have some sort of delimeter? </p>

<hr>

<p>Ive tried the following oly its acting very weird and printing out multiple times? </p>

<p>the following...</p>

<pre><code>$interestsquery  = "SELECT * FROM user_interests WHERE user_id = " . $usersClass-&gt;userID();
$result = mysql_query($interestsquery);

while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
 $interests[] = $row['interest'];
 $interest1 = $interests[0];
 $interest2 = $interests[1];
 $interest3 = $interests[2];

 print $interest1 . " - " . $interest2 . " - " . $interest3;

} 
</code></pre>

<p>Prints out </p>

<p>"Tennis - Tennis - Footy - Tennis -Soccer - Footy"</p>
