Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2007
    Location
    england
    Posts
    536
    Tokens
    0

    Default Display multiple entries

    PHP Code:
    <?php
    include ("includes/global.php");

    $n mysql_query("SELECT uid FROM updates WHERE uid = '$oid'");
    $number mysql_num_rows($n);

    $u mysql_query("SELECT * FROM updates WHERE uid = '$oid'");
    $update mysql_fetch_array($u);

    $user mysql_query("SELECT * FROM users WHERE id = '$oid'");
    $username mysql_fetch_array($user);

    if(
    $number == "0"){
        echo 
    "You have no status updates.";
    } else {
        echo 
    "{$username['username']} is {$update['message']}";
    }

    ?>
    right now it only displays the most recent update, how do I make it display all the entries by that user? thx

    Edit by Robbie! (Forum Moderator) - Moved to Coding Help, please post in the correct section next time, thanks.
    Last edited by Robbie; 19-02-2009 at 08:36 PM.


    Selling DJ/Habbo layout, more info here.


  2. #2
    Join Date
    Jan 2006
    Location
    Kent
    Posts
    987
    Tokens
    0

    Default

    I think this would work.
    PHP Code:
    <?php
    include ("includes/global.php");

    $n mysql_query("SELECT uid FROM updates WHERE uid = '$oid'");
    $number mysql_num_rows($n);

    $u mysql_query("SELECT * FROM updates WHERE uid = '$oid'");

    $user mysql_query("SELECT * FROM users WHERE id = '$oid'");
    $username mysql_fetch_array($user);

    if (
    $number == "0")
    {
        echo 
    "You have no status updates.";
    }
    else
    {
        while (
    $update mysql_fetch_array($u))
        {
            echo 
    "{$username['username']} is {$update['message']}";
        }
    }

    ?>
    This is our situation and we're happy to be here,
    I wouldn't change this place for anything.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •