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.

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
    }
    ?>
    SEMrush
    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
    SEMrush
  2. saadi123

    saadi123 Active Member

    Messages:
    188
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #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