3v4l.org

run code in 300+ PHP versions simultaneously
<?php //this code shows friend suggestions. //******************************************************************************** // // User Id wgaira ka code dekh lena, is script me use krne k liye. OK. $user_id set honi chahye! // //******************************************************************************** // select all users in table: tbluser $searchq = "SELECT * FROM tbluser WHERE user_id <> '$user_id' LIMIT 5"; // it will show 4/5 suggestions. change to whatever you want $searchresult = mysql_query($searchq) or die(mysql_error()); while($row_user = mysql_fetch_array($searchresult)){ // check if user is friend or not $fon="SELECT * FROM friends WHERE (user_id = '$user_id') OR (friend_id = '$user_id')"; $result = mysql_query($fon) or die(mysql_error()); $row = mysql_num_rows($result); // if user is not in friend list i.e $row=0 if ($row == 0) { $uid = $row_user['id']; $user_photo = $row_user['photo']; $fullname = $row_user['fname'].' '.$row_user['lname']; // you can change the link to add friend $add_friend_link = '<a style="font-size: small;" href="add_friend.php?fid='.$uid.'">Add as friend</a>'; //you can change this html to suit your needs $html = '<img src="'.$user_photo.'" align="absmiddle" alt="'.$fullname.'" title="'.$fullname.'"></img>'.$fullname.'<br/>'.$add_friend_link.' <br/><br/>'; //show the html code(friend suggestions) echo $html; //if user is in friend list, following code will show next friend suggestion } else { continue; } } $fname = '5'; $lname = '65'; $fullname = $row_user['fname'].' '.$row_user['lname']; echo $fullname; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 66, Position 2 = 14
Branch analysis from position: 66
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 47) Position 1 = 25, Position 2 = 29
Branch analysis from position: 25
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 60
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
filename:       /in/H6VHf
function name:  (null)
number of ops:  75
compiled vars:  !0 = $searchq, !1 = $user_id, !2 = $searchresult, !3 = $fon, !4 = $result, !5 = $row, !6 = $uid, !7 = $row_user, !8 = $user_photo, !9 = $fullname, !10 = $add_friend_link, !11 = $html, !12 = $fname, !13 = $lname
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ROPE_INIT                                     3  ~15     'SELECT+%2A+FROM+tbluser+WHERE+user_id+%3C%3E+%27'
          1        ROPE_ADD                                      1  ~15     ~15, !1
          2        ROPE_END                                      2  ~14     ~15, '%27+LIMIT+5'
          3        ASSIGN                                                   !0, ~14
   14     4        INIT_FCALL_BY_NAME                                       'mysql_query'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $18     
          7        ASSIGN                                           ~19     !2, $18
          8      > JMPNZ_EX                                         ~19     ~19, ->13
          9    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         10        DO_FCALL                                      0  $20     
         11      > EXIT                                                     $20
         12*       BOOL                                             ~19     <true>
   16    13    > > JMP                                                      ->61
   18    14    >   ROPE_INIT                                     5  ~22     'SELECT+%2A+FROM+friends+WHERE+%28user_id+%3D+%27'
         15        ROPE_ADD                                      1  ~22     ~22, !1
         16        ROPE_ADD                                      2  ~22     ~22, '%27%29+OR+%28friend_id+%3D+%27'
         17        ROPE_ADD                                      3  ~22     ~22, !1
         18        ROPE_END                                      4  ~21     ~22, '%27%29'
         19        ASSIGN                                                   !3, ~21
   20    20        INIT_FCALL_BY_NAME                                       'mysql_query'
         21        SEND_VAR_EX                                              !3
         22        DO_FCALL                                      0  $26     
         23        ASSIGN                                           ~27     !4, $26
         24      > JMPNZ_EX                                         ~27     ~27, ->29
         25    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         26        DO_FCALL                                      0  $28     
         27      > EXIT                                                     $28
         28*       BOOL                                             ~27     <true>
   22    29    >   INIT_FCALL_BY_NAME                                       'mysql_num_rows'
         30        SEND_VAR_EX                                              !4
         31        DO_FCALL                                      0  $29     
         32        ASSIGN                                                   !5, $29
   24    33        IS_EQUAL                                                 !5, 0
         34      > JMPZ                                                     ~31, ->60
   25    35    >   FETCH_DIM_R                                      ~32     !7, 'id'
         36        ASSIGN                                                   !6, ~32
   26    37        FETCH_DIM_R                                      ~34     !7, 'photo'
         38        ASSIGN                                                   !8, ~34
   27    39        FETCH_DIM_R                                      ~36     !7, 'fname'
         40        CONCAT                                           ~37     ~36, '+'
         41        FETCH_DIM_R                                      ~38     !7, 'lname'
         42        CONCAT                                           ~39     ~37, ~38
         43        ASSIGN                                                   !9, ~39
   29    44        CONCAT                                           ~41     '%3Ca+style%3D%22font-size%3A+small%3B%22+href%3D%22add_friend.php%3Ffid%3D', !6
         45        CONCAT                                           ~42     ~41, '%22%3EAdd+as+friend%3C%2Fa%3E'
         46        ASSIGN                                                   !10, ~42
   31    47        CONCAT                                           ~44     '%3Cimg+src%3D%22', !8
         48        CONCAT                                           ~45     ~44, '%22+align%3D%22absmiddle%22+alt%3D%22'
         49        CONCAT                                           ~46     ~45, !9
         50        CONCAT                                           ~47     ~46, '%22+title%3D%22'
         51        CONCAT                                           ~48     ~47, !9
         52        CONCAT                                           ~49     ~48, '%22%3E%3C%2Fimg%3E'
         53        CONCAT                                           ~50     ~49, !9
         54        CONCAT                                           ~51     ~50, '%3Cbr%2F%3E'
         55        CONCAT                                           ~52     ~51, !10
         56        CONCAT                                           ~53     ~52, '+%3Cbr%2F%3E%3Cbr%2F%3E'
         57        ASSIGN                                                   !11, ~53
   33    58        ECHO                                                     !11
         59      > JMP                                                      ->61
   36    60    > > JMP                                                      ->61
   16    61    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
         62        SEND_VAR_EX                                              !2
         63        DO_FCALL                                      0  $55     
         64        ASSIGN                                           ~56     !7, $55
         65      > JMPNZ                                                    ~56, ->14
   40    66    >   ASSIGN                                                   !12, '5'
   41    67        ASSIGN                                                   !13, '65'
   42    68        FETCH_DIM_R                                      ~59     !7, 'fname'
         69        CONCAT                                           ~60     ~59, '+'
         70        FETCH_DIM_R                                      ~61     !7, 'lname'
         71        CONCAT                                           ~62     ~60, ~61
         72        ASSIGN                                                   !9, ~62
   43    73        ECHO                                                     !9
   45    74      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.39 ms | 1399 KiB | 13 Q