Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Mix Queries?

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #38949
    schart
    Participant

    So basically, I’m making a facebook-like wall. Now I have a database where I store every wallpost by who posts, where, contents etc.
    When making this wall, mixing every post made by everyone the user follows, the wall got organized by the name rather than the
    ids. So it became “Posts by James” then their posts, then “Post by Bob” and his posts, although the posts should be one by each sorted
    by ID. Here is somewhat how I made the wall:


    $queryz = mysql_query("SELECT * FROM users_follow_table WHERE hefollows = '$username' ORDER BY RAND()");
    $aquery = mysql_query("SELECT * FROM users_wall_table WHERE name = '$fname' ORDER BY unique_id DESC LIMIT 0, 3");
    while ($rowz = mysql_fetch_assoc($aquery)){
    $unique_id = $rowz;
    $idwhoto = $rowz;
    $whotonameq = mysql_query("SELECT * FROM users_table WHERE id = '$idwhoto'");
    while($manz = mysql_fetch_assoc($whotonameq)){
    $whotoname = $manz;
    }
    $idwhois = $rowz;
    $comment = $rowz;
    $img = $rowz;
    ?>
    something like
    ...
    }}
    ?>

    The results would be something like this:

    Post by James 12th

    Post by James 15th

    ---
    Post by Bob 13th

    Post by bob 17th

    You see my point? – Now this is not exactly what it is, if you see any bugs it’s because of the c/p and editing, not the code itself, it is working.

    I know there is, but do you know of a better way to do this?

    Thanks
    – Schart

Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.