Jump to content

create row on per timing


mark103

Recommended Posts

Hi guys,

I am working on my tv guide website that I output the data to my php from mysql database. I want to know how i can work it out the tv time for per programme how long they would last for, e.g 30 mins, 1 hour...etc

<html>

<body>

<style type="text/css">

#channel1 {

    position:absolute;

    font-family:Arial;

    font-size:29px;

    font-style:normal;

    font-weight:bold;

    color:f5fdfd;

    text-decoration:none;

    text-transform:none;

    visibility:visible;

    overflow:hidden;

    left:35px; top:245px; width:176px; height:50px;

    z-index:1;

}

#programme1 {

    position:absolute;

    font-family:Arial;

    font-size:29px;

    font-style:normal;

    font-weight:bold;

    color:f5fdfd;

    text-decoration:none;

    text-transform:none;

    visibility:visible;

    overflow:hidden;

    left:427px; top:245px; width:176px; height:50px;

    z-index:1;

}

#programme2 {

    position:absolute;

    font-family:Arial;

    font-size:29px;

    font-style:normal;

    font-weight:bold;

    color:f5fdfd;

    text-decoration:none;

    text-transform:none;

    visibility:visible;

    overflow:hidden;

    left:765px; top:245px; width:176px; height:50px;

    z-index:1;

}

#programme3 {

    position:absolute;

    font-family:Arial;

    font-size:29px;

    font-style:normal;

    font-weight:bold;

    color:f5fdfd;

    text-decoration:none;

    text-transform:none;

    visibility:visible;

    overflow:hidden;

    left:1110px; top:245px; width:176px; height:50px;

    z-index:1;

}

#day {

    font-family:Arial;

    font-size:29px;

    font-style:normal;

    font-weight:bold;

    color:f5fdfd;

    text-decoration:none;

    text-transform:none;

    position:absolute;

    visibility:visible;

    overflow:hidden;

    left:294px; top:180px; width:176px; height:50px;

    z-index:0;

}

#time1 {

    font-family:Arial;

    font-size:29px;

    font-style:normal;

    font-weight:bold;

    color:f5fdfd;

    text-decoration:none;

    text-transform:none;

    position:absolute;

    visibility:visible;

    overflow:hidden;

    left:424px; top:180px; width:176px; height:50px;

    z-index:0;

}

#time2 {

    font-family:Arial;

    font-size:29px;

    font-style:normal;

    font-weight:bold;

    color:f5fdfd;

    text-decoration:none;

    text-transform:none;

    position:absolute;

    visibility:visible;

    overflow:hidden;

    left:754px; top:180px; width:176px; height:50px;

    z-index:0;

}

#time3 {

    font-family:Arial;

    font-size:29px;

    font-style:normal;

    font-weight:bold;

    color:f5fdfd;

    text-decoration:none;

    text-transform:none;

    position:absolute;

    visibility:visible;

    overflow:hidden;

    left:1104px; top:180px; width:176px; height:50px;

    z-index:0;

}

<?php

include("get-listing.php");

?>

<div id="image1" style="position:absolute; overflow:hidden; visibility:visible; left:21px; top:245px; width:374px; height:40px; z-index:0"><img src="/images/row1_yellow.jpg" alt="" title="" border=0 width=374 height=50></div>

<div id="image2" style="position:absolute; overflow:hidden; visibility:visible; left:21px; top:295px; width:374px; height:40px; z-index:0"><img src="/images/row1.jpg" alt="" title="" border=0 width=374 height=50></div>

<div id="image3" style="position:absolute; overflow:hidden; visibility:visible; left:21px; top:345px; width:374px; height:40px; z-index:0"><img src="/images/row1.jpg" alt="" title="" border=0 width=374 height=50></div>

</body>

</html> 



I am using the row1 as per image to resize it for per programme, but i have no idea how i can compare with each timing for per programme before resizing on per image.

here is what my php displaying:

<span id='time1'>1:00 PM</span> - <span id='title1'>SportsCenter</span><br></br><span id='time2'>2:00 PM</span> - <span id='title2'>SportsCenter</span><br></br><span id='time3'>3:00 PM</span> - <span id='title3'>SportsCenter Special: On the Clock</span><br></br><span id='time4'>4:00 PM</span> - <span id='title4'>NFL Live</span><br></br>


I want to know how to work it out on per timing how long the programme will last for, e.g I want to work it out between time1 and time2 to find out how long it will last which it make 60 mins.

Does anyone know how i can compare with each timing on per programme before resizing on per image?

Any advice would be much appreicated.

Thanks in advance Edited by mark103
Link to comment
Share on other sites

Sorry I have forgotten to include the code for get-listing.php.

 

Here it is:

<html>
 <body>
 <script>
  function ajaxpage(str)
  {
    if (window.XMLHttpRequest)
    { // code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
    }
    else
    {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
    }
    xmlhttp.onreadystatechange=function()
    {
      if (xmlhttp.readyState==4 && xmlhttp.status==200)
      {
      }
    }
    xmlhttp.open("GET",".php?q="+str,true);
    xmlhttp.send();
  }
 </script>
 <?php
    define('DB_HOST', 'localhost');
  define('DB_USER', 'myusername');
  define('DB_PASSWORD', 'mypassword');
  define('DB_DATABASE', 'mydbname_tvguide');
       
  $errmsg_arr = array();
  $errflag = false;
  $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
    
  if(!$link) 
  {
    die('Failed to connect to server: ' . mysql_error());
  }

  $db = mysql_select_db(DB_DATABASE);
  if(!$db) 
  {
    die("Unable to select database");
  }

  if($errflag) 
  {
    $_SESSION['ERRMSG_ARR'] = $errmsg_arr;
    echo implode('<br />',$errmsg_arr);
  }
  else 
  {
    $qrytable1="SELECT id, channels FROM tvguide";
    $result1=mysql_query($qrytable1) or die('Error:<br />' . $qry . '<br />' . mysql_error());
     
    while ($row = mysql_fetch_array($result1))
    {
      echo "</br>";
      echo "<td>".$row['channels']."</td>";
      echo "</br>";
    } 
  }
mysql_close($link);
?>
</body>
</html>

I want to know how i can resizing the images for per programme in my php when I want to comare the timing for per programme how long the programme will last for, e.g 30 mins, 60 mins...etc

 

do you know how i can compare the timing for per programme using with this tags?

<span id='time1'>1:00 PM</span><span id='time2'>2:00 PM</span><span id='time3'>4:00 PM</span><span id='time4'>5:00 PM</span>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.