onenonly Posted June 8, 2009 Share Posted June 8, 2009 $query = "SELECT * FROM movie, game"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)){ echo "<table>"; echo "<tr><td>".$row["type"]."</td></tr>"; echo "<tr><td>".$row["name"]."</td></tr>"; echo "<tr><td>".$row["date"]."</td></tr>"; echo "<tr><td>".$row["picture"]."</td></tr>"; echo "<tr><td>".$row["description"]."</td></tr>"; echo "</table>"; echo "<BR><BR>"; } it doesnt work I want all records to show both table are not connected by any means Quote Link to comment https://forums.phpfreaks.com/topic/161322-solved-show-all-data-from-two-table/ Share on other sites More sharing options...
gevans Posted June 8, 2009 Share Posted June 8, 2009 Have you tried that query (SELECT * FROM movie, game) through phpmyadmin's sql console to check it works? Quote Link to comment https://forums.phpfreaks.com/topic/161322-solved-show-all-data-from-two-table/#findComment-851296 Share on other sites More sharing options...
gevans Posted June 8, 2009 Share Posted June 8, 2009 Sorry, should've read more thoroughly first. If there's nothing joining the tables this can't be done, it will return 2 sets of results Quote Link to comment https://forums.phpfreaks.com/topic/161322-solved-show-all-data-from-two-table/#findComment-851297 Share on other sites More sharing options...
onenonly Posted June 8, 2009 Author Share Posted June 8, 2009 nvm i got it union all works great Quote Link to comment https://forums.phpfreaks.com/topic/161322-solved-show-all-data-from-two-table/#findComment-851366 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.