I have a weird problem and I can't figure it out.
I have this select :
So far so good, but the problem is when I'm trying to add a second table in the select, like this:
Now the problem is that instead of 4 rows that it should show in the mysql_fetch_assoc, show those 4 rows again and again and so on...
What I am doing wrong?
I have this select :
PHP Code:
$select = mysql_query("SELECT user_id, torrent_id, torrentname FROM wishlist WHERE user_id = '".$USER['id']."'") or die (mysql_error());
while ($row = mysql_fetch_assoc($select)){
echo "<a href='details.php?id=".$row['torrent_id']."'>".$row['torrentname']."</a><br/>";
}
PHP Code:
$select = mysql_query("SELECT wishlist.user_id as uid, wishlist.torrent_id as wtid, wishlist.torrentname as wtn, categories.id FROM wishlist, categories WHERE wishlist.user_id = '".$USER['id']."'") or die (mysql_error());
while ($row = mysql_fetch_assoc($select)){
echo "<a href='details.php?id=".$row['wtid']."'>".$row['wtn']."</a><br/>";
}
What I am doing wrong?
Comment