daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest Aug 12th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. /**
  4.  * @author Joshua
  5.  * @copyright 2011
  6.  */
  7.  
  8. @mysql_connect("localhost", "root", "lol123");
  9. @mysql_select_db("tinyapp");
  10. $user = "Josh";
  11. $query = mysql_query("SELECT * FROM friends WHERE friend1 = '{$user}'");
  12. while( $friends = mysql_fetch_array( $query ) ) {
  13.     $find_posts = mysql_query( "SELECT * FROM posts WHERE user = '{$friends[friend2]}' OR staff = '1'" );
  14.     if( mysql_num_rows( $find_posts ) != 0 ) {
  15.        while( $posts = mysql_fetch_array( $find_posts ) ) {
  16.         echo $posts["message"];
  17.         echo "<br />";
  18.        }
  19.     }
  20. }
  21.  
  22.  
  23.  
  24. ?>
RAW Paste Data
Top