Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- need help


udwo - 6:48 pm on Aug 21, 2012 (gmt 0)


Hello everyone,

i am not an expert in mySQL/php and need help. i have two tables in my DB and i need to extract channel description and logos combined with what is currently played on the channel. NOTE: I don't have a control over the table(epg) that provides the info on what is played and when. that table comes to me from different source via cron and I can't alter the table nor request any changes. with that said; this is what i have:

table 1: tblTVChannels
columns: tvChannelID, epg_ID, tvChannelsDesc, tvChannelsLogo, tvChannelsActive, tvChannelPosition

table 2: epg
columns: id_epg, start, title, dascription

i got this to work when i only need to sow specific channel with following:

SELECT epg.id_epg, epg.id_channel, epg.title, epg.description, tblTVChannels.tvChannelsLogo, tblTVChannels.tvChannelsDesc FROM epg INNER JOIN tblTVChannels ON epg.id_channel = tblTVChannels.epg_ID WHERE epg.start < '$programDate' AND tblTVChannels.tvChannelID = '$channelID' ORDER BY epg.start DESC

this works well. now i need to show all channels that are currently active(tvChannelsActive=1) and pull the info from epg table. epg table has multiple entries for hte same programs brodcasted at different start time (Y-m-d H:i:s) format

i hope i described what i need.


Thread source:: http://www.webmasterworld.com/php/4486927.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com