Jump to content

Recommended Posts

Hi guys,

 

I am working on my tv guide website and I start to kick it off. I am going to store the channels name in a mysql database, but I am not sure how to input each channel name in each different div tag like "channel1", "channel2", "channel3", "channel4", "channel5 and "channel6" when I store more than 4 channels in the database. Does anyone know how?

 

The second things I want to know how I can check on the tv guide program website to compare the time how long the program will last for so I can then resize the image and input each program title in each text on each image instead of create the rows?

 

Any advice would be much appreciated.

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/276435-how-to-make-tv-guide-in-php/
Share on other sites

It got nothing to do with you, it is for my own private use. however, I have output the data from mysql to html, but i don't know how to read the php in html. do you know how?

 

And do you know how i can check the program time on the programme website to see how long the programme will last for, e.g the programme start to run 8:00pm to 8:30pm. Do you know how?

I was actually concerned about your table structure and if it limited the channels.

 

But I won't ask any more questions, nor will I answer any.

 

I understand that and I appriecated it, but you don't need to ask about what is the significance of "more than 4" channels. However, I need to find a way for solution.

 

I have created a mysql database to store the website information which I am using this:

 

<?php
session_start();
  define('DB_HOST', 'localhost');
  define('DB_USER', 'myusername');
  define('DB_PASSWORD', 'mypassword');
  define('DB_DATABASE', 'mydbname');
       
  $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))
    {
      document.getElementById("channel1").style.visibility = "visible";
      document.getElementById("channel1").innerHTML = $row['channel'];
    }
  }
?>

 

Now I want to link up the php file in html. Do you know how I can do this and how I can output the data from php to html?

 

Do you know how I can get access to each website when I storing the website links in mysql database and how I can compare the range of programme time before I could resize on each image?

 

I don't want to included my username and password in html as I don't want to take the risk to get my website to get hacking.

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.