3raser Posted April 3, 2011 Share Posted April 3, 2011 Here is the original query: $query_extract = mysql_query("SELECT downloads,date,title,username,views,id FROM skins ORDER BY id DESC LIMIT 100"); Is it possible to also grab the row username from the table users, without making multiple queries? Quote Link to comment Share on other sites More sharing options...
Zurev Posted April 3, 2011 Share Posted April 3, 2011 Give this a shot: SELECT s.downloads,s.date,s.title,s.username,s.views,s.id FROM skins s, users u WHERE s.username = u.username ORDER BY s.id DESC LIMIT 100 Dusty on my SQL, may not work... Quote Link to comment Share on other sites More sharing options...
3raser Posted April 3, 2011 Author Share Posted April 3, 2011 I tried this: $query_extract = mysql_query("SELECT s.downloads,s.date,s.title,s.username,s.views,s.id,u.status,u.username FROM skins s, users u WHERE s.username = u.username ORDER BY s.id DESC LIMIT 100"); while($row = mysql_fetch_assoc($query_extract)) { if($row['u.status'] == 1) $row['s.username'] = "dgjldfgjdflg"; echo "<tr><td><img src='skins/". $row['id'] .".png'></td><td><a href='view.php?id=". $row['id'] ."'>". $row['title'] ."</a></td><td>". $row['username'] ."</td><td>". $row['date'] ."</td><td>". $row['downloads'] ."</td><td>". $row['views'] ."</td></tr>"; } Yet, the user's name doesn't change. :/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.