1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

need help with output the data to html

Discussion in 'PHP' started by mark103, Apr 9, 2013.

  1. #1
    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>";
        }
      }
    ?>
    Code (markup):

    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.
     
    mark103, Apr 9, 2013 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    You are already outputting it to html! please give a better description of what you need!
     
    EricBruggema, Apr 9, 2013 IP