3v4l.org

run code in 300+ PHP versions simultaneously
<?php //set up the database connection $servername = "192.129.1.209"; $username = "meaadmin"; $password = "Kasten_15&"; $dbname = "typo3mea"; $conn = mysql_connect($servername, $username, $password); mysql_select_db($dbname); echo "connected successfully" . '<br>'; //read the json file content $jsondata = file_get_contents('http://127.0.0.1:8000/api/thesis/?format=json'); //convert json object to php array $data = json_decode($jsondata); //var_dump($data); //get the thesis details //$id = $data['id']; //$author = $data['author']; //$type = $data['type']; //$title = $data['title']; //$year = $data['year']; //insert into mysql table foreach($data -> title as $title) { $sql = "INSERT INTO mea_thesis(title) VALUES('$title')"; } //debug if(!mysql_query($sql,$conn)) { die('Error : '.mysql_error()); } //database connection close mysql_close($conn); echo "Hello Munir :D"; //print $data["objects"]; //echo $data; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 30
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 30
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 41
Branch analysis from position: 37
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/lejgr
function name:  (null)
number of ops:  46
compiled vars:  !0 = $servername, !1 = $username, !2 = $password, !3 = $dbname, !4 = $conn, !5 = $jsondata, !6 = $data, !7 = $title, !8 = $sql
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '192.129.1.209'
    4     1        ASSIGN                                                   !1, 'meaadmin'
    5     2        ASSIGN                                                   !2, 'Kasten_15%26'
    6     3        ASSIGN                                                   !3, 'typo3mea'
    7     4        INIT_FCALL_BY_NAME                                       'mysql_connect'
          5        SEND_VAR_EX                                              !0
          6        SEND_VAR_EX                                              !1
          7        SEND_VAR_EX                                              !2
          8        DO_FCALL                                      0  $13     
          9        ASSIGN                                                   !4, $13
    8    10        INIT_FCALL_BY_NAME                                       'mysql_select_db'
         11        SEND_VAR_EX                                              !3
         12        DO_FCALL                                      0          
   10    13        ECHO                                                     'connected+successfully%3Cbr%3E'
   12    14        INIT_FCALL                                               'file_get_contents'
         15        SEND_VAL                                                 'http%3A%2F%2F127.0.0.1%3A8000%2Fapi%2Fthesis%2F%3Fformat%3Djson'
         16        DO_ICALL                                         $16     
         17        ASSIGN                                                   !5, $16
   14    18        INIT_FCALL                                               'json_decode'
         19        SEND_VAR                                                 !5
         20        DO_ICALL                                         $18     
         21        ASSIGN                                                   !6, $18
   24    22        FETCH_OBJ_R                                      ~20     !6, 'title'
         23      > FE_RESET_R                                       $21     ~20, ->30
         24    > > FE_FETCH_R                                               $21, !7, ->30
   26    25    >   ROPE_INIT                                     3  ~23     'INSERT+INTO+mea_thesis%28title%29+%0AVALUES%28%27'
   27    26        ROPE_ADD                                      1  ~23     ~23, !7
         27        ROPE_END                                      2  ~22     ~23, '%27%29'
   26    28        ASSIGN                                                   !8, ~22
   24    29      > JMP                                                      ->24
         30    >   FE_FREE                                                  $21
   31    31        INIT_FCALL_BY_NAME                                       'mysql_query'
         32        SEND_VAR_EX                                              !8
         33        SEND_VAR_EX                                              !4
         34        DO_FCALL                                      0  $26     
         35        BOOL_NOT                                         ~27     $26
         36      > JMPZ                                                     ~27, ->41
   33    37    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         38        DO_FCALL                                      0  $28     
         39        CONCAT                                           ~29     'Error+%3A+', $28
         40      > EXIT                                                     ~29
   37    41    >   INIT_FCALL_BY_NAME                                       'mysql_close'
         42        SEND_VAR_EX                                              !4
         43        DO_FCALL                                      0          
   39    44        ECHO                                                     'Hello+Munir+%3AD'
   42    45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.77 ms | 1400 KiB | 17 Q