Thread: Lost

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    9
    Rep Power
    0
    I'm having a little trouble,
    I have a script that when run shows
    a list of available forums with the number
    of posts next to it. I want to show the output of this php script in a table on another page.
    I've tried require(), Include() to no avail
    Is there a way to do this??

    TIA

    Slim
  2. #2
  3. Senior Member
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jun 2000
    Location
    Enschede, The Netherlands
    Posts
    1,527
    Rep Power
    16
    Assuming you only want the table included in the other page you could do something like this I guess:

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>
    // table.php
    <?php
    mysql_connect( ip, user, pwd );
    mysql_select( db );
    $result = mysql_query( "SELECT * FROM tablename" );
    if ( $row = mysql_fetch_array( $result ) ) {
    print( "<table>" );
    print( "<tr>" );
    print( "<td>Forum</td>" );
    print( "<td>Posts</td>" );
    print( "</tr>" );
    do {
    print( "<tr>" );
    print( "<td>".$row["forum"]."</td>" );
    print( "<td>".$row["posts"]."</td>" );
    print( "</tr>" );
    }
    while( $row = mysql_fetch_array( $result ) );
    print( "</table>" );
    }
    else {
    print( "There are no forums in the database" );
    }
    ?>
    [/quote]

    Then, you can use this part over and over again:

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>
    // page1.php
    <?php
    print( "<html><head><title></title></head><body>" );
    print( "<p>Page 1</p>" );
    print( "<p>" );
    include( "table.php" );
    print( "</p>" );
    print( "</body></html>" );
    ?>
    [/quote]

    And so on and so on...

    Greetings + success

    Mirax


    [This message has been edited by Mirax (edited October 14, 2000).]
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    9
    Rep Power
    0
    Thanks!!!

Similar Threads

  1. Lost connection to MySQL server during query
    By bcraft in forum MySQL Help
    Replies: 1
    Last Post: December 9th, 2003, 07:58 AM
  2. Recovering a lost password
    By jaffacake2000 in forum PHP Development
    Replies: 9
    Last Post: November 13th, 2003, 04:30 PM
  3. lost data on reboot
    By sreeli in forum MySQL Help
    Replies: 2
    Last Post: August 19th, 2003, 04:24 AM
  4. Replies: 3
    Last Post: October 7th, 2002, 10:26 AM
  5. hdc: lost interrupt
    By Reean in forum Linux Help
    Replies: 0
    Last Post: March 18th, 2002, 11:00 PM

IMN logo majestic logo threadwatch logo seochat tools logo