I put
$result1=mysql_query("SELECT categoryid FROM user_category WHERE userid='$user_id'");
$cat=mysql_fetch_assoc($result1);
foreach($cat as $value) {
$result2=mysql_query("SELECT categoryid, category FROM categories WHERE categoryid='$value'");}
while($row=mysql_fetch_assoc($result2)) {
echo "<option value=".$row['categoryid'].">".$row['category']."</option>";}
But ti didn;t work 🙁🙁
user_category is a table that contains the userid and the categoryid, one user many categories.
So i expected that $cat returns an array with all the categoryid's but it didn't happen but only one categoryid appeared.
What have i done wrong?