Zephyris Posted February 6, 2008 Share Posted February 6, 2008 Like this: section1_news(id, title, msg, datetime) section2_news(id, title, msg, datetime) like: $result = mysql_query("SELECT * FROM section1_news, section2_news"); but like by datetime and LIMIT of 5 rows. outputing the most recent news from the combined two tables.. displaying a max of 5 results. Quote Link to comment Share on other sites More sharing options...
haku Posted February 6, 2008 Share Posted February 6, 2008 If both your tables have the exact same columns, they should be in one table. Just add another column to differentiate between the two sets of data. For example, if you have a table called Japanese news, and a table called English news, and the column names are exactly the same, you should just use one table called news, then add an extra column called country, filling it in with the applicable country from which the news came from. Then when you are doing your query, you set your query conditions and leave out any reference to country, and it will bring back all news. Quote Link to comment Share on other sites More sharing options...
rameshfaj Posted February 6, 2008 Share Posted February 6, 2008 I dont understand your problem,is it in query or what?If it is in query then ucan use more than one table at a time using joins. Quote Link to comment Share on other sites More sharing options...
Zephyris Posted February 6, 2008 Author Share Posted February 6, 2008 my test script is basicly <?php // Get Gaming Headlines $result = mysql_query("SELECT * FROM `gaming_news`, `community_news`"); while($row = mysql_fetch_array($result) ){ echo("<td class='10whitebold'>" . ($row['title']) . "</td>"); } ?> only displays community news Quote Link to comment Share on other sites More sharing options...
hamza Posted February 6, 2008 Share Posted February 6, 2008 <?php // Get Gaming Headlines $result = mysql_query("SELECT * FROM `gaming_news`, `community_news`"); while($row = mysql_fetch_array($result) ){ echo("<td class='10whitebold'>" . ($row['title']) . "</td>"); } ?> Dear you are just using $row['title'] title to show the title from two pages you are not mentioning the anyother thing to show you like date or other try to do like this while($row = mysql_fetch_array($result) ){ echo("<td class='10whitebold'>" . ($row['title']) . "</td>"); echo("<td class='10whitebold'>" . ($row['news']) . "</td>"); echo("<td class='10whitebold'>" . ($row['date']) . "</td>"); or any other coulmn } if you still not able to do it let me know ............................... Quote Link to comment Share on other sites More sharing options...
Zephyris Posted February 6, 2008 Author Share Posted February 6, 2008 Nope, no go. It's only taking the data from one table. Only community news are coming out and none from the gaming news are outputing.. 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.