Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Member unclekyky's Avatar
    Join Date
    Sep 2003
    Posts
    62
    Member #
    2938
    I know that there is info in the database but nothing is displayed on the page.

    PHP Code:
    <?php 

    $db 
    mysql_connect("localhost","webjunk","*****") die(mysql_error()); 
    mysql_select_db ("webjunk_test") or die(mysql_error()); 

    $query "SELECT name, comments FROM post"
        
    $result mysql_query($query); 
        echo 
    "<TABLE>"
        while(
    $r=mysql_fetch_array($result))     
        { 
            echo 
    "<TR> 
                <TD><font size='2'> 
     <b>
    $r['name']</b></font></TD>  
                <TD><font size='2'>
    $r[comments]</font></TD> 
            </TR> 
            "

             
        } 
        echo 
    "</TABLE>"

    ?>

  2.  

  3. #2
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    Try...

    PHP Code:
    <?php 

    $db 
    mysql_connect("localhost","webjunk","*****") die(mysql_error()); 
    mysql_select_db ("webjunk_test") or die(mysql_error()); 

    $query "SELECT `name`, `comments` FROM `post`"
        
    $result mysql_query($query); 
        echo 
    "<TABLE>"
        while(
    $r=mysql_fetch_array($result))     
        { 
            echo 
    "<TR> 
                <TD><font size='2'> 
     <b>"
    .$r['name']."</b></font></TD>  
                <TD><font size='2'>"
    .$r['comments']."</font></TD> 
            </TR> 
            "

             
        } 
        echo 
    "</TABLE>"

    ?>
    JR

  4. #3
    Member unclekyky's Avatar
    Join Date
    Sep 2003
    Posts
    62
    Member #
    2938
    thanks it worked


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:05 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com