Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2013
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. <?php
  2. #get friends
  3. $kack = "1";
  4. $query = $conn->prepare('SELECT * FROM '.$tb['conre'].' WHERE '.$cr['to'].' = :id OR '.$cr['from'].' = :id AND '.$cr['state'].' = :state ');
  5. $query->execute(array(
  6.     ':id' => $user_id,
  7.     ':state' => $kack
  8. ));
  9. $result = $query->fetchAll();
  10. if ( count($result) ){
  11.    
  12.     #for each friend
  13.     foreach($result as $row){
  14.  
  15.         echo "Freundschaft : ".$row[$cr['to']]." + ".$row[$cr['from']];
  16.         $query = $conn->prepare('SELECT * FROM '.$tb['feed'].' WHERE '.$feed['user'].' = :id AND '.$feed['about'].' = :id2 OR '.$feed['about'].' = :id AND '.$feed['user'].' = :id2 ORDER BY '.$feed['time'].' DESC ');
  17.         $query->execute(array(
  18.             ':id' => $row[$cr['to']],
  19.             ':id2' => $row[$cr['from']]
  20.         ));
  21.         $result = $query->fetchAll();
  22.         if ( count($result) ){
  23.             #for each new friendship
  24.             foreach($result as $row) {
  25.  
  26. [..........]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement