www.webdeveloper.com
Results 1 to 3 of 3

Thread: need help with output the data to html

  1. #1
    Join Date
    Sep 2008
    Posts
    62

    need help with output the data to html

    Hi guys,

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

    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.
    Last edited by mark107; 04-09-2013 at 10:27 AM.

  2. #2
    Join Date
    May 2003
    Posts
    599
    What happens when you run this code?
    We do precision guesswork

  3. #3
    Join Date
    Sep 2008
    Posts
    62
    nothing is happens. it isn't doing anything as far im using html.

    any idea?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles