3v4l.org

run code in 300+ PHP versions simultaneously
<?php $verbindung = mysqli_connect("server","user","pw"); mysqli_select_db($verbindung,"userdaten"); /* Ermittlung der eigenen ID */ $abfrage = "select userid from accountdaten where username = '" . $_SESSION["username"] . "'"; $ergebnis = mysqli_query($verbindung, $abfrage) OR die("Error: $abfrage <br>".mysqli_error()); $row = mysqli_fetch_assoc($ergebnis); /* Ermittlung der ID des Freundes */ $abfrage2 = "select freundid from freunde where userid = " . $row["userid"] . ""; $ergebnis2 = mysqli_query($verbindung, $abfrage2) OR die("Error: $abfrage2 <br>".mysqli_error()); $row2 = mysqli_fetch_assoc($ergebnis2); $num = mysqli_num_rows($ergebnis2); /* Prüfung, ob man bisher schon Freunde hat */ if($num == 0) { echo "Du hast bisher noch keine Freunde."; } else { /* Ermittlung des Usernamen und den Online-Status des Freundes */ $abfrage3 = "select username, online from accountdaten where userid = " . $row2["freundid"] . ""; $ergebnis3 = mysqli_query($verbindung, $abfrage3) OR die("Error: $abfrage3 <br>".mysqli_error()); $row3 = mysqli_fetch_assoc($ergebnis3); /* Ermittlung der Userdaten, die für die Ausgabe gebraucht werden */ $abfrage4 = "select nation, klasse, Level from userwerte where userid = " . $row2["freundid"] . ""; $ergebnis4 = mysqli_query($verbindung, $abfrage4) OR die("Error: $abfrage4 <br>".mysqli_error()); echo "<table>"; echo "<thead><tr> <th>Name</th> <th>Herkunft</th> <th>Klasse</th> <th>Level</th> <th>Online-Status</th> </tr></thead> <tbody>"; while($dsatz = mysqli_fetch_array($ergebnis4, MYSQL_ASSOC)) { echo "<tr>"; /* Wie kann ich $row3 mit in die while Funktion einbringen? */ echo "<td>" . $row3["username"] . "</td>"; echo "<td>" . $dsatz["nation"] . "</td>"; echo "<td>" . $dsatz["klasse"] . "</td>"; echo "<td>" . $dsatz["Level"] . "</td>"; echo "<td></td>"; echo "</tr>"; } echo "</tbody></table>"; } mysqli_close($verbindung); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 21, Position 2 = 29
Branch analysis from position: 21
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 47) Position 1 = 43, Position 2 = 51
Branch analysis from position: 43
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 51
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 63
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 133
Branch analysis from position: 133
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 63
2 jumps found. (Code = 47) Position 1 = 73, Position 2 = 81
Branch analysis from position: 73
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 81
2 jumps found. (Code = 47) Position 1 = 95, Position 2 = 103
Branch analysis from position: 95
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 103
1 jumps found. (Code = 42) Position 1 = 125
Branch analysis from position: 125
2 jumps found. (Code = 44) Position 1 = 132, Position 2 = 106
Branch analysis from position: 132
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 106
2 jumps found. (Code = 44) Position 1 = 132, Position 2 = 106
Branch analysis from position: 132
Branch analysis from position: 106
filename:       /in/aqmn8
function name:  (null)
number of ops:  137
compiled vars:  !0 = $verbindung, !1 = $abfrage, !2 = $ergebnis, !3 = $row, !4 = $abfrage2, !5 = $ergebnis2, !6 = $row2, !7 = $num, !8 = $abfrage3, !9 = $ergebnis3, !10 = $row3, !11 = $abfrage4, !12 = $ergebnis4, !13 = $dsatz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL_BY_NAME                                       'mysqli_connect'
          1        SEND_VAL_EX                                              'server'
          2        SEND_VAL_EX                                              'user'
          3        SEND_VAL_EX                                              'pw'
          4        DO_FCALL                                      0  $14     
          5        ASSIGN                                                   !0, $14
    3     6        INIT_FCALL_BY_NAME                                       'mysqli_select_db'
          7        SEND_VAR_EX                                              !0
          8        SEND_VAL_EX                                              'userdaten'
          9        DO_FCALL                                      0          
    6    10        FETCH_R                      global              ~17     '_SESSION'
         11        FETCH_DIM_R                                      ~18     ~17, 'username'
         12        CONCAT                                           ~19     'select+userid+from+accountdaten+where+username+%3D+%27', ~18
         13        CONCAT                                           ~20     ~19, '%27'
         14        ASSIGN                                                   !1, ~20
    7    15        INIT_FCALL_BY_NAME                                       'mysqli_query'
         16        SEND_VAR_EX                                              !0
         17        SEND_VAR_EX                                              !1
         18        DO_FCALL                                      0  $22     
         19        ASSIGN                                           ~23     !2, $22
         20      > JMPNZ_EX                                         ~23     ~23, ->29
         21    >   ROPE_INIT                                     3  ~25     'Error%3A+'
         22        ROPE_ADD                                      1  ~25     ~25, !1
         23        ROPE_END                                      2  ~24     ~25, '+%3Cbr%3E'
         24        INIT_FCALL_BY_NAME                                       'mysqli_error'
         25        DO_FCALL                                      0  $27     
         26        CONCAT                                           ~28     ~24, $27
         27      > EXIT                                                     ~28
         28*       BOOL                                             ~23     <true>
    8    29    >   INIT_FCALL_BY_NAME                                       'mysqli_fetch_assoc'
         30        SEND_VAR_EX                                              !2
         31        DO_FCALL                                      0  $29     
         32        ASSIGN                                                   !3, $29
   10    33        FETCH_DIM_R                                      ~31     !3, 'userid'
         34        CONCAT                                           ~32     'select+freundid+from+freunde+where+userid+%3D+', ~31
         35        CONCAT                                           ~33     ~32, ''
         36        ASSIGN                                                   !4, ~33
   11    37        INIT_FCALL_BY_NAME                                       'mysqli_query'
         38        SEND_VAR_EX                                              !0
         39        SEND_VAR_EX                                              !4
         40        DO_FCALL                                      0  $35     
         41        ASSIGN                                           ~36     !5, $35
         42      > JMPNZ_EX                                         ~36     ~36, ->51
         43    >   ROPE_INIT                                     3  ~38     'Error%3A+'
         44        ROPE_ADD                                      1  ~38     ~38, !4
         45        ROPE_END                                      2  ~37     ~38, '+%3Cbr%3E'
         46        INIT_FCALL_BY_NAME                                       'mysqli_error'
         47        DO_FCALL                                      0  $40     
         48        CONCAT                                           ~41     ~37, $40
         49      > EXIT                                                     ~41
         50*       BOOL                                             ~36     <true>
   12    51    >   INIT_FCALL_BY_NAME                                       'mysqli_fetch_assoc'
         52        SEND_VAR_EX                                              !5
         53        DO_FCALL                                      0  $42     
         54        ASSIGN                                                   !6, $42
   13    55        INIT_FCALL_BY_NAME                                       'mysqli_num_rows'
         56        SEND_VAR_EX                                              !5
         57        DO_FCALL                                      0  $44     
         58        ASSIGN                                                   !7, $44
   16    59        IS_EQUAL                                                 !7, 0
         60      > JMPZ                                                     ~46, ->63
   18    61    >   ECHO                                                     'Du+hast+bisher+noch+keine+Freunde.'
         62      > JMP                                                      ->133
   23    63    >   FETCH_DIM_R                                      ~47     !6, 'freundid'
         64        CONCAT                                           ~48     'select+username%2C+online+from+accountdaten+where+userid+%3D+', ~47
         65        CONCAT                                           ~49     ~48, ''
         66        ASSIGN                                                   !8, ~49
   24    67        INIT_FCALL_BY_NAME                                       'mysqli_query'
         68        SEND_VAR_EX                                              !0
         69        SEND_VAR_EX                                              !8
         70        DO_FCALL                                      0  $51     
         71        ASSIGN                                           ~52     !9, $51
         72      > JMPNZ_EX                                         ~52     ~52, ->81
         73    >   ROPE_INIT                                     3  ~54     'Error%3A+'
         74        ROPE_ADD                                      1  ~54     ~54, !8
         75        ROPE_END                                      2  ~53     ~54, '+%3Cbr%3E'
         76        INIT_FCALL_BY_NAME                                       'mysqli_error'
         77        DO_FCALL                                      0  $56     
         78        CONCAT                                           ~57     ~53, $56
         79      > EXIT                                                     ~57
         80*       BOOL                                             ~52     <true>
   25    81    >   INIT_FCALL_BY_NAME                                       'mysqli_fetch_assoc'
         82        SEND_VAR_EX                                              !9
         83        DO_FCALL                                      0  $58     
         84        ASSIGN                                                   !10, $58
   28    85        FETCH_DIM_R                                      ~60     !6, 'freundid'
         86        CONCAT                                           ~61     'select+nation%2C+klasse%2C+Level+from+userwerte+where+userid+%3D+', ~60
         87        CONCAT                                           ~62     ~61, ''
         88        ASSIGN                                                   !11, ~62
   29    89        INIT_FCALL_BY_NAME                                       'mysqli_query'
         90        SEND_VAR_EX                                              !0
         91        SEND_VAR_EX                                              !11
         92        DO_FCALL                                      0  $64     
         93        ASSIGN                                           ~65     !12, $64
         94      > JMPNZ_EX                                         ~65     ~65, ->103
         95    >   ROPE_INIT                                     3  ~67     'Error%3A+'
         96        ROPE_ADD                                      1  ~67     ~67, !11
         97        ROPE_END                                      2  ~66     ~67, '+%3Cbr%3E'
         98        INIT_FCALL_BY_NAME                                       'mysqli_error'
         99        DO_FCALL                                      0  $69     
        100        CONCAT                                           ~70     ~66, $69
        101      > EXIT                                                     ~70
        102*       BOOL                                             ~65     <true>
   31   103    >   ECHO                                                     '%3Ctable%3E'
   32   104        ECHO                                                     '%3Cthead%3E%3Ctr%3E%0A+++++++++++++%3Cth%3EName%3C%2Fth%3E%0A+++++++++++++%3Cth%3EHerkunft%3C%2Fth%3E%0A+++++++++++++%3Cth%3EKlasse%3C%2Fth%3E%0A+++++++++++++%3Cth%3ELevel%3C%2Fth%3E%0A+++++++++++++%3Cth%3EOnline-Status%3C%2Fth%3E%0A+++++++++++++%3C%2Ftr%3E%3C%2Fthead%3E%0A+++++++++++++%3Ctbody%3E'
   40   105      > JMP                                                      ->125
   42   106    >   ECHO                                                     '%3Ctr%3E'
   44   107        FETCH_DIM_R                                      ~71     !10, 'username'
        108        CONCAT                                           ~72     '%3Ctd%3E', ~71
        109        CONCAT                                           ~73     ~72, '%3C%2Ftd%3E'
        110        ECHO                                                     ~73
   45   111        FETCH_DIM_R                                      ~74     !13, 'nation'
        112        CONCAT                                           ~75     '%3Ctd%3E', ~74
        113        CONCAT                                           ~76     ~75, '%3C%2Ftd%3E'
        114        ECHO                                                     ~76
   46   115        FETCH_DIM_R                                      ~77     !13, 'klasse'
        116        CONCAT                                           ~78     '%3Ctd%3E', ~77
        117        CONCAT                                           ~79     ~78, '%3C%2Ftd%3E'
        118        ECHO                                                     ~79
   47   119        FETCH_DIM_R                                      ~80     !13, 'Level'
        120        CONCAT                                           ~81     '%3Ctd%3E', ~80
        121        CONCAT                                           ~82     ~81, '%3C%2Ftd%3E'
        122        ECHO                                                     ~82
   48   123        ECHO                                                     '%3Ctd%3E%3C%2Ftd%3E'
   49   124        ECHO                                                     '%3C%2Ftr%3E'
   40   125    >   INIT_FCALL_BY_NAME                                       'mysqli_fetch_array'
        126        SEND_VAR_EX                                              !12
        127        FETCH_CONSTANT                                   ~83     'MYSQL_ASSOC'
        128        SEND_VAL_EX                                              ~83
        129        DO_FCALL                                      0  $84     
        130        ASSIGN                                           ~85     !13, $84
        131      > JMPNZ                                                    ~85, ->106
   51   132    >   ECHO                                                     '%3C%2Ftbody%3E%3C%2Ftable%3E'
   53   133    >   INIT_FCALL_BY_NAME                                       'mysqli_close'
        134        SEND_VAR_EX                                              !0
        135        DO_FCALL                                      0          
   54   136      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.58 ms | 1411 KiB | 13 Q