Hello,
Not sure where i should begin with this(building a tvguide, xmltv epg data is in the mysql server) , my echo calls mysql and mysql returns start and stop date and time plus ofc the other data i ask for but thats not important here i want to just display parts of the output based on the date and time returned from the mysql. Like current date and time + 3h(so i can see whats on now and eg. 3hours ahead). Like echo is now it displays all times and all the programmes for 24h. Ill post the code :
[php]
<?php mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $sql="select channel, start, stop, start_date, title, desc from programmes where channel = 'disneychannel.no' "; $rs=mysql_query($sql) or die($sql.">>".mysql_error()); $num=mysql_num_rows($rs); if($num>0){ echo "channel | "; echo "start | "; echo "stop | "; echo "title | "; # echo "desc | "; echo "
---|---|---|---|---|
{$channel} | "; echo "{$start} | "; echo "{$stop} | "; echo "{$title} | "; # echo "{$desc} | "; echo "
[/php]
this displays:
disneychannel.no 2011/12/10 06:20:00 2011/12/10 06:45:00 Fairly Odd Parents
disneychannel.no 2011/12/10 06:45:00 2011/12/10 07:10:00 Sabrina The Animated Series
disneychannel.no 2011/12/10 07:10:00 2011/12/10 07:35:00 Lykke til, Charlie!
disneychannel.no 2011/12/10 07:35:00 2011/12/10 08:00:00 Art Attack
disneychannel.no 2011/12/10 08:00:00 2011/12/10 09:10:00 Q-gjengen
disneychannel.no 2011/12/10 09:10:00 2011/12/10 09:20:00 En god latter!
disneychannel.no 2011/12/10 09:20:00 2011/12/10 09:30:00 En god latter!
etc… so you can see that its too much data to display 24h of programming for lets say 10 channels, so idealy I need to get the local time on the server, drop the data before that time and display whats on now and eg 3h ahead.
Input greatly apreciated.
Thanks
Emph