PHP string and <h1></h1> tags.

Discussion in 'PHP' started by saadi123, Jul 8, 2010.

  1. #1
    I am using following code to retrieve data from database and print it on the screen.

    <?php
    include("mysql_connect.php");
    mysql_select_db("my_db", $con_mysql_db);
    $result = mysql_query("SELECT post_title, post_body From posts");
    while($row = mysql_fetch_array($result))
    {
    echo $row[0]; // displays post title
    print("<br/>");
    print($row[1]); // displays post body
    }
    ?>

    The above code is working fine. However I have a problem when I try to wrap the $row[0] string in <h1></h1> tags. The whole page gets blank.
    Please tell me how can I use <h1> tags so that I can display the string text as a heading.
     
    saadi123, Jul 8, 2010 IP
  2. saadi123

    saadi123 Well-Known Member

    Messages:
    196
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #2
    Hey I have figured it out. So this post is closed.
     
    saadi123, Jul 8, 2010 IP
  3. damoolag

    damoolag Well-Known Member

    Messages:
    311
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #3
    Good for you ^_^
     
    damoolag, Jul 8, 2010 IP