#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Randolph, NJ
    Posts
    36
    Rep Power
    15
    What do I do to make a page that it shows all of the entries in my MySQL database? I have a simple database thing right now at:
    http://tsr4.tsrealm.com/goodtsr/WhereTo/whereto.shtml

    After that I want it so a reader can view the all of the entries. Thank you for all the help.
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    Edit the following exmple as per your requirment..

    populate.php3

    <?php
    $con=mysql_connect (localhost,username,password);

    //connect to the database...

    mysql_select_db("databasename",$con);

    //select your database..


    $result=mysql_query("select * from tablename",$con);

    //get all the datas from the table

    if ($row = mysql_fetch_array($result)) {
    //loop through all your records..
    do {
    print $row["field1"];
    print $row["field2"];
    print $row["field3"];
    print $row["field4"];
    print $row["field5"];
    }while($row = mysql_fetch_array($result));
    }else{
    // no record for your query...
    print "No Records!!";
    }
    ?>

    ------------------
    SR -
    webshiju.com

    "The fear of the LORD is the beginning of knowledge..."

    [This message has been edited by Shiju Rajan (edited June 29, 2000).]
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Randolph, NJ
    Posts
    36
    Rep Power
    15
    Thank you very much. I will see how this works. Thanks!

    ------------------
    ================
    -Khill, www.tsrealm.com

Similar Threads

  1. new to PHP-MySQL, deleting entries from database
    By gyppo100 in forum MySQL Help
    Replies: 4
    Last Post: February 1st, 2004, 11:37 AM
  2. Whois Servers and nomatch value
    By computer in forum Dev Shed Lounge
    Replies: 7
    Last Post: November 7th, 2003, 07:06 AM
  3. eliminating duplicate entries
    By calebdzahnd in forum MySQL Help
    Replies: 2
    Last Post: December 30th, 2002, 03:39 PM
  4. How to return a random set of DB entries without repetition?
    By indivision in forum PHP Development
    Replies: 2
    Last Post: May 15th, 2002, 01:33 AM

IMN logo majestic logo threadwatch logo seochat tools logo