itsureboy Posted July 24, 2009 Share Posted July 24, 2009 Is it possible to display data from two different tables with different data types, and order them by a certain field in sync - (using date based on my example below). Kind of like a news feed. For some reason this doesn't come simple to thought. Maybe it's just me, but it seems really complicated, unless there's an easier way with PHP. For example, lets say I have these two tables. Table 1 Below: Table 2 Below: ---------------------------- ---------------------------- ID | COMMENT | DATE | ID | PICTURE | DATE | ---------------------------- ---------------------------- AND order them based on the DATE uploaded/posted: COMMENT ----------- COMMENT ---------- PICTURE ---------- COMMENT ---------- PICTURE ---------- PICTURE (for example) Hope this isn't to confusing, because I sure am confused after trying to figure out ways of going about doing this. *****I don't need exact code, just a method. Link to comment https://forums.phpfreaks.com/topic/167216-is-it-possible-to/ Share on other sites More sharing options...
xtopolis Posted July 24, 2009 Share Posted July 24, 2009 Use a UNION. Also, your column "DATE" is a reserved word, consider changing it. Link to comment https://forums.phpfreaks.com/topic/167216-is-it-possible-to/#findComment-881684 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.