3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //Loads Comments (used as an include) $qc = mysql_query("SELECT * FROM group_comments WHERE msg_id='$msg_id' order by com_id asc ") or die(mysql_error()); while($comment = mysql_fetch_array($qc)){ $id=$comment['com_id']; $comment=tolink(htmlentities($comment['comment'] )); $time=$comment['created']; $uid=$comment['uid']; $resultname = mysql_query("SELECT * FROM `tbluser` WHERE `id` = '$uid'") or die(mysql_error()); $row_name = mysql_fetch_array($resultname); $fullname = $row_name['fname'].' '.$row_name['lname']; $user_photo = $row_name['photo']; $user_photo="http://nitofa.com/user_pics/users/".$user_photo; $q3 = mysql_query("SELECT * FROM groups WHERE id = '$gid' AND admin = '$user_id'"); $info = mysql_fetch_array($q3); $admin = mysql_num_rows($q3); ?> <div class="stcommentbody" id="stcommentbody<?php echo $id; ?>"> <div class="stcommentimg"> <img src="<?php echo $user_photo; ?>" class='small_face'/> </div> <div class="stcommenttext"> <?php if($admin == 1){ //if user is admin, than we will also show delete link! echo '<a class="stcommentdelete" href="deletecomment.php?id='.$id.'&gid='.$gid.'" id="'.$id.'" title="Delete comment">X</a>'; } elseif($uid==$user_id){ //if the post is by the user than delete link is shown also! echo '<a class="stcommentdelete" href="deletecomment.php?id='.$id.'&gid='.$gid.'" id="'.$id.'" title="Delete comment">X</a>'; } ?> <b><a href="<?php echo 'http://nitofa.com/browse-user.php?fid='.$uid; ?>"><?php echo $fullname; ?></a></b> <?php echo $comment; ?> <div class="stcommenttime"><?php time_stamp($time); ?></div> </div> </div> <?php } ?>
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function mysql_query() in /in/YBQtA:5 Stack trace: #0 {main} thrown in /in/YBQtA on line 5
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: msg_id in /in/YBQtA on line 5 Warning: supplied argument is not a valid MySQL-Link resource in /in/YBQtA on line 5 Warning: supplied argument is not a valid MySQL-Link resource in /in/YBQtA on line 5
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function mysql_query() in /in/YBQtA on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Notice: Undefined variable: msg_id in /in/YBQtA on line 5 Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/YBQtA on line 5 Warning: mysql_query(): A link to the server could not be established in /in/YBQtA on line 5 Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: msg_id in /in/YBQtA on line 5 Warning: mysql_query() [http://www.php.net/function.mysql-query]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/YBQtA on line 5 Warning: mysql_query() [http://www.php.net/function.mysql-query]: A link to the server could not be established in /in/YBQtA on line 5 Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)