Jump to content

mark103

Members
  • Posts

    268
  • Joined

  • Last visited

Posts posted by mark103

  1. 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>
    
  2. 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
  3. Yes, BUT I SAID I WANT TO SCRAPE THE  TITLE THAT IS ON TODAY IN THE CURRENT TIME UNTIL TO THE END OF THE PAGE AND NOT YESTERDAY. I WANT TO DISPLAY THEM IN MY PHP:

     

    The USA current time is 10:00PM

    10:00 PM Baseball Tonight
    
        LIVE
    
    11:00 PM SportsCenter
    
        LIVE
    
    Tomorrow
    12:00 AM SportsCenter
    
        LIVE
    
    1:00 AM SportsCenter
    
        LIVE
    
    2:00 AM SportsCenter
    
        LIVE
    
    3:00 AM SportsCenter
    
    4:00 AM SportsCenter
    

    Not like this:

    ( Yesterday-7:00 PM) Dec 31, 1969 7:00PM - Around the Horn
    ( Yesterday-7:00 PM) Dec 31, 1969 7:00PM - Pardon the Interruption
    ( Yesterday-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter
    ( Yesterday-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter Special
    (Last Night-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter Special: On the Clock
    (Last Night-7:00 PM) Dec 31, 1969 7:00PM - NFL Live
    (Last Night-7:00 PM) Dec 31, 1969 7:00PM - Baseball Tonight
    (Last Night-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter
    ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter
    ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter
    ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter
    ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter
    ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter
    ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter
    ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter
    ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter
    ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter
    ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter
    ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter
    ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter
    ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter
    ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter
    ( Today-7:00 PM) Dec 31, 1969 7:00PM - SportsCenter
    ( Today-7:00 PM) Dec 31, 1969 7:00PM - Outside the Lines
    ( Today-7:00 PM) Dec 31, 1969 7:00PM - College Football Live

    Are you thick???????

  4. Thanks, I have input the code in my php and I saw the list of title included the time. You have got it wrong there and you don't understand what I want to achieve. Let me explain to you again. I want to scrape the data in the current time in the USA that are 5 hours behind my current time which my current time is 3:00am and the usa time is 10:00pm.

     

    Please see the data that show in the programme current time like this:

    10:00 PM Baseball Tonight
    
        LIVE
    
    11:00 PM SportsCenter
    
        LIVE
    
    Tomorrow
    12:00 AM SportsCenter
    
        LIVE
    
    1:00 AM SportsCenter
    
        LIVE
    
    2:00 AM SportsCenter
    
        LIVE
    
    3:00 AM SportsCenter
    
    4:00 AM SportsCenter

    Now I hope you get my point?

  5. thanks, could you please post the code that i could use cURL or strtotime to get the correct time 5 hours back from my current time to get the correct data in that website, e.g my current time is 10pm and i look for the time that is 5 hours backward which it is 5pm and get the data that show at 5pm??

  6. thanks you very much for your help, but there is a problem. There is no output data when I am using this:

    <?php
    
    $data = file_get_contents('http://tvlistings.zap2it.com/tvlistings/ZCSGrid.do?stnNum=10179');
    $p = "/a id='rowTitle1' class='zc-ssl-pg-title'>(.*)<\/a>/";
    preg_match($p, $html, $match);
    echo $match[0];
    ?>

    i am not really sure if i have done it wrong.

     

    can you help?

  7. Hi,

    I am having a problem with scraping the data from the website. I can't be able to output the data to my php after I have scraping the data from the website. On my php it show as a empty page.

    here is the html source I want to scrape:

    <span id="row3Time" class="zc-ssl-pg-time">11:00 AM</span>
    <a id="rowTitle3" class="zc-ssl-pg-title" href='http://tvlistings.zap2it.com/tv/sportscenter/EP00019917'>SportsCenter</a>
    <ul class="zc-icons">
    <li class="zc-ic zc-ic-span"><span class="zc-ic-live">LIVE</span></li></ul>
    </li>
    <li class="zc-ssl-pg" id="row1-4" style="">
    
    <span id="row4Time" class="zc-ssl-pg-time">12:00 PM</span>
    <a id="rowTitle4" class="zc-ssl-pg-title" href='http://tvlistings.zap2it.com/tv/sportscenter/EP00019917'>SportsCenter</a>
    <ul class="zc-icons">
    <li class="zc-ic zc-ic-span"><span class="zc-ic-live">LIVE</span></li></ul>
    </li>
    <li class="zc-ssl-pg" id="row1-5" style="">
    
    <span id="row5Time" class="zc-ssl-pg-time">1:00 PM</span>
    <a id="rowTitle5" class="zc-ssl-pg-title" href='http://tvlistings.zap2it.com/tv/sportscenter/EP00019917'>SportsCenter</a>
    <ul class="zc-icons">
    <li class="zc-ic zc-ic-span"><span class="zc-ic-live">LIVE</span></li></ul>

    here is the php source:

    
    <?php
    
    $contents = file_get_contents('http://tvlistings.zap2it.com/tvlistings/ZCSGrid.do?stnNum=10179');
    preg_match('/<a id="rowTitle3" class="zc-ssl-pg-title"[.*]<\/a>/i', $data, $matches);
    $rowtitle = $matches[1];
    echo $rowtitle."<br>\n";
    ?>
    



    And here is the php output:

    <br>



    does anyone know how I can scraping the data from that website using with <a id=rowTitle3 to the end of the page?

    any advice would be much appreicated.

    Thanks in advance

  8. No you didn't, you only told me to do something like this:

     

    echo "<span id='text1'>".$row['mydata']."</span>";

     

     

    all of the data are joined in one tag. I cannot make them get separate via split them up to ouput in each different tag.

     

    Please read my first post again before you say something.

  9. Hi guys,

     

    I have stored data in a MySQL database and I've output it in PHP. I want to know how I can output the data in different <span id="text1">` tags from `<tr><td>` tags.

        <?php
          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, mydata FROM mydb ";
            $result1=mysql_query($qrytable1) or die('Error:<br />' . $qry . '<br />' . mysql_error());
       
             while ($row = mysql_fetch_array($result1))
            {
              echo "<tr><td>".$row['mydata']."</td></tr>";
            }
          }
        ?>
    



    On my PHP page it show something like this:

        <tr><td>my data 1</td></tr><tr><td>my data 2</td></tr><tr><td>my data 3</td></tr><tr><td>my data 4</td></tr>



    How can I split the output the data into an array before I could output them in different <span id="text1">` tags from `<tr><td>` tags?

    any advice would be much appreicated.

     

    thanks in advance

     

  10. Hi guys,

    I need your help. I got a problem with my php script where i cannot ignore the warning: session_start. The warning I get is: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/myusername/public_html/test.php:6) in /home/myusername/public_html/test.php on line 7

     

     

        <html>
         <body>
        
        
        <table>
        <?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))
            {
              echo "<tr><td>".$row['channels']."</td></tr>";
        
            }
          }
        ?>
        </table>
        </html>

     


    Does anyone know what the trouble is and how to remove the warning session_start?

    thanks in advance

  11. Hi guys,

    I need your help. I got a problem with my php script where i cannot ignore the warning: session_start. The warning I get is: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/myusername/public_html/test.php:6) in /home/myusername/public_html/test.php on line 7

     

        <html>
         <body>
        
        
        <table>
        <?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))
            {
              echo "<tr><td>".$row['channels']."</td></tr>";
        
            }
          }
        ?>
        </table>
        </html>


    Does anyone know what the trouble is and how to remove the warning session_start?

    thanks in advance

  12. Hi guys,

    I have stored the data in mysql database where I can ouput them in php using with this following code:
     


    <?php
    
    session_start();
    
      define('DB_HOST', 'localhost');
    
      define('DB_USER', 'mydbusername');
    
      define('DB_PASSWORD', 'mydbpassword');
    
      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))
    
        {
    
          echo "</br>";
    
          echo "<td>".$row['channels']."</td>";
    
          echo "</br>";
    
        }
    
      }
    
    ?>

    I want to know how I can output the data from php to html, do you know how?

    if so please can you help me.

    thanks in advance.

     

  13. Hi guys,

    I need your help have stored the information in mysql database where I can print the output data in my php using with this following code:
     

     

    <?php
    session_start();
      define('DB_HOST', 'localhost');
      define('DB_USER', 'mydbusername');
      define('DB_PASSWORD', 'mydbpassword');
      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))
        {
          echo "</br>";
          echo "<td>".$row['channels']."</td>";
          echo "</br>";
        }
      }
    ?>
     

     

    There is a problem, I can't be able to print the output data in html.

     

    here is the code:

     

     

    <html>
    <body>
    
    <style type="text/css">
    
    #channel1 {
    font-family:Arial;
    font-size:29px;
    font-style:normal;
    font-weight:bold;
    color:f5fdfd;
    text-decoration:none;
    text-transform:none;
    position:absolute;
    visibility:hidden;
    overflow:hidden;
    left:194px; top:345px; width:176px; height:50px;
    z-index:0;
    }
    
    #channel2 {
    font-family:Arial;
    font-size:29px;
    font-style:normal;
    font-weight:bold;
    color:f5fdfd;
    text-decoration:none;
    text-transform:none;
    position:absolute;
    visibility:hidden;
    overflow:hidden;
    left:194px; top:345px; width:176px; height:50px;
    z-index:0;
    }
    
    #channel3 {
    font-family:Arial;
    font-size:29px;
    font-style:normal;
    font-weight:bold;
    color:f5fdfd;
    text-decoration:none;
    text-transform:none;
    position:absolute;
    visibility:hidden;
    overflow:hidden;
    left:194px; top:345px; width:176px; height:50px;
    z-index:0;
    }
    
    #channel4 {
    font-family:Arial;
    font-size:29px;
    font-style:normal;
    font-weight:bold;
    color:f5fdfd;
    text-decoration:none;
    text-transform:none;
    position:absolute;
    visibility:hidden;
    overflow:hidden;
    left:194px; top:345px; width:176px; height:50px;
    z-index:0;
    }
    
    #channel5 {
    font-family:Arial;
    font-size:29px;
    font-style:normal;
    font-weight:bold;
    color:f5fdfd;
    text-decoration:none;
    text-transform:none;
    position:absolute;
    visibility:hidden;
    overflow:hidden;
    left:194px; top:345px; width:176px; height:50px;
    z-index:0;
    }
    
    #channel6 {
    font-family:Arial;
    font-size:29px;
    font-style:normal;
    font-weight:bold;
    color:f5fdfd;
    text-decoration:none;
    text-transform:none;
    position:absolute;
    visibility:hidden;
    overflow:hidden;
    left:194px; top:345px; width:176px; height:50px;
    z-index:0;
    }
    
    <span id="channel1"></span>
    
    <span id="channel2"></span>
    
    <span id="channel3"></span>
    
    <span id="channel4"></span>
    
    <span id="channel5"></span>
    
    <span id="channel6"></span>
    
    function ajaxpage(str)
    {
    if (str == "")
    {
    document.getElementById("channel1").innerHTML = "";
    document.getElementById("channel2").innerHTML = "";
    document.getElementById("channel3").innerHTML = "";
    document.getElementById("channel4").innerHTML = "";
    document.getElementById("channel5").innerHTML = "";
    document.getElementById("channel6").innerHTML = "";
    return;
    }
    
    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)
    {
    document.getElementById("channel1").innerHTML=xmlhttp.responseText;
    }
    }
    xmlhttp.open("GET","tvguide.php?q="+str,true);
    xmlhttp.send();
    }
    </script>
    <form action="tvguide.php" method="post">
    </body>
    </html>
     

     

    do you know how i can print the output data to html from php using with ajax?

     

    any advice would be much appriecated.

     

    thanks in advance

  14. Hi guys,

    I need your help. I have stored the information in mysql database where I can print it out in my php using with this following code:

    <?php
    session_start();
      define('DB_HOST', 'localhost');
      define('DB_USER', 'mydbusername');
      define('DB_PASSWORD', 'mydbpassword');
      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))
        {
          echo "</br>";
          echo "<td>".$row['channels']."</td>";
          echo "</br>";
        }
      }
    ?>




    Now I want to know how I can output the data from php to html, do you know how?

    if you do then i need your help.

    thanks in advance.

×
×
  • 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.