3v4l.org

run code in 300+ PHP versions simultaneously
<?php // internal include file $qfu = "SELECT * FROM my_friends WHERE (user_id = '$user_id' OR friend_id = '$user_id') AND status = '1'"; $fu = mysql_query($qfu) or die(mysql_error()); $rowfu = mysql_num_rows($fu); if ($rowfu == 0 ) { // the user has no friend echo "No friends!"; } else { while($rowf = mysql_fetch_array($fu)){ if($user_id==$rowf['user_id']){ $fid=$rowf['friend_id']; } else { $fid=$rowf['user_id']; } $querymsgs = "SELECT M.msg_id, M.uid_fk, M.message, M.created, M.privacy, U.fname, U.lname FROM messages M, tbluser U WHERE (U.id='$fid' or U.id='$user_id') and (M.uid_fk='$fid' or M.uid_fk='$fid') and (M.privacy='1' or M.privacy='2') order by M.msg_id desc LIMIT $_i, $limit "; $qmsgs = mysql_query($querymsgs) or die(mysql_error()); $row_msgs = mysql_num_rows($qmsgs); if($row_msgs==0){ continue; } else { $msgs = mysql_fetch_array($qmsgs); $msg_id=$msgs['msg_id']; $orimessage=$msgs['message']; $message=tolink(htmlentities($msgs['message'])); $time=$msgs['created']; $privacy=$msgs['privacy']; if($privacy=='0'){ $privacy='Only Me';} elseif($privacy=='2'){ $privacy='Public';} else { $privacy='Friends';} $uid=$msgs['uid_fk']; $fullname=$msgs['fname']." ".$msgs['lname']; $face=$Wall->Avatar($uid); $commentsarray=$Wall->Comments($msg_id); } ?> <script type="text/javascript"> $(document).ready(function(){$("#stexpand<?php echo $msg_id;?>").oembed("<?php echo $orimessage; ?>",{maxWidth: 400, maxHeight: 300});}); </script> <div class="stbody" id="stbody<?php echo $msg_id;?>"> <div class="stimg"> <img src="<?php echo $face;?>" class='big_face'/> </div> <div class="sttext"> <a class="stdelete" href="#" id="<?php echo $msg_id;?>" title="Delete update">X</a> <b><a href="<?php echo 'http://nitofa.com/browse-user.php?fid='.$uid;?>"><?php echo $fullname;?></a></b> <br/><?php echo $message;?> <div class="sttime"><?php time_stamp($time);?> | <a href='#commentbox<?php echo $msg_id;?>' class='commentopen' id='<?php echo $msg_id;?>' title='Comment'>Comment </a> |<!-- <a href="share.php?msg_id=<?php echo $msg_id;?>">Share</a> |--> <?php include('likeunlike.php'); ?> | <?php echo $privacy;?></div> <div id="stexpandbox"> <div id="stexpand<?php echo $msg_id;?>"></div> </div> <div class="commentcontainer" id="commentload<?php echo $msg_id;?>"> <?php include('load_comments.php'); ?> </div> <div class="commentupdate" style='display:none;' id='commentbox<?php echo $msg_id;?>'> <div class="stcommentimg"> <img src="<?php echo $face;?>" class='small_face'/> </div> <div class="stcommenttext" > <form method="post" action="comment_ajax.php"> <textarea name="comment" class="comment" maxlength="200" id="ctextarea<?php echo $msg_id;?>"></textarea> <br /> <input type="submit" value=" Comment " id="<?php echo $msg_id;?>" class="comment_button"/> </form> </div> </div> </div> </div> <?php } } if(!$_GET['next']){ $page = '2'; } else { $page = $_GET['next']+1; } ?> <a style="text-align:center;margin:0 auto;" href="wall.php?next=<?=$page?>">View More</a>

preferences:
45.13 ms | 402 KiB | 5 Q