3v4l.org

run code in 300+ PHP versions simultaneously
<?php define("DB_HOST", "www.sql2.webzdarma.cz"); define("DB_USER", "taxidiary.wz6133"); define("DB_PASSWORD", "v6ir53b3"); define("DB_DATABASE", "taxidiary.wz6133"); $conn = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!mysql_select_db(DB_DATABASE)) { print "Připojení k DB selhalo..."; } $selected_db = mysql_select_db("jizdy", $conn); if(!$selefcted_db) { echo "DB not found"; } function store_drive($from, $to, $price) { $date = date("Y-n-d H:i:s"); $result = mysql_query("INSERT INTO jizdy(odkud, kam, cena, datum) VALUES('".$from."','".$to."','".$price."','".$date."')"); } if(isset($POST['submit'])) { $from = isset($POST['from']) ? $POST['from'] :""; $to = isset($POST['to']) ? $POST['to'] :""; $price = isset($POST['price']) ? $POST['price'] :""; if(isset($POST['price'])) { store_drive($from, $to, $price); } } function get_week() { $date = date("Y-n-d"); $result = mysql_query("SELECT * FROM jizdy WHERE datum >= '$date'"); $rows = mysql_num_rows($result); while($row = mysql_fetch_array($rows, MYSQL_ASSOC)) { print("<tr> <td>".$row['odkud']."</td> <td>".$row['kam']."</td> <td>".$row['cena']."</td> <td>".$row['datum']."</td> </tr>"); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 32
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 40
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 70
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 47
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 54
Branch analysis from position: 51
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
2 jumps found. (Code = 43) Position 1 = 58, Position 2 = 61
Branch analysis from position: 58
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 70
Branch analysis from position: 65
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 70
Branch analysis from position: 61
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 70
Branch analysis from position: 65
Branch analysis from position: 70
Branch analysis from position: 54
2 jumps found. (Code = 43) Position 1 = 58, Position 2 = 61
Branch analysis from position: 58
Branch analysis from position: 61
Branch analysis from position: 47
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 54
Branch analysis from position: 51
Branch analysis from position: 54
Branch analysis from position: 70
Branch analysis from position: 40
Branch analysis from position: 32
filename:       /in/jZoa7
function name:  (null)
number of ops:  71
compiled vars:  !0 = $conn, !1 = $selected_db, !2 = $selefcted_db, !3 = $POST, !4 = $from, !5 = $to, !6 = $price
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'DB_HOST'
          2        SEND_VAL                                                 'www.sql2.webzdarma.cz'
          3        DO_ICALL                                                 
    4     4        INIT_FCALL                                               'define'
          5        SEND_VAL                                                 'DB_USER'
          6        SEND_VAL                                                 'taxidiary.wz6133'
          7        DO_ICALL                                                 
    5     8        INIT_FCALL                                               'define'
          9        SEND_VAL                                                 'DB_PASSWORD'
         10        SEND_VAL                                                 'v6ir53b3'
         11        DO_ICALL                                                 
    6    12        INIT_FCALL                                               'define'
         13        SEND_VAL                                                 'DB_DATABASE'
         14        SEND_VAL                                                 'taxidiary.wz6133'
         15        DO_ICALL                                                 
    8    16        INIT_FCALL_BY_NAME                                       'mysql_connect'
         17        FETCH_CONSTANT                                   ~11     'DB_HOST'
         18        SEND_VAL_EX                                              ~11
         19        FETCH_CONSTANT                                   ~12     'DB_USER'
         20        SEND_VAL_EX                                              ~12
         21        FETCH_CONSTANT                                   ~13     'DB_PASSWORD'
         22        SEND_VAL_EX                                              ~13
         23        DO_FCALL                                      0  $14     
         24        ASSIGN                                                   !0, $14
    9    25        INIT_FCALL_BY_NAME                                       'mysql_select_db'
         26        FETCH_CONSTANT                                   ~16     'DB_DATABASE'
         27        SEND_VAL_EX                                              ~16
         28        DO_FCALL                                      0  $17     
         29        BOOL_NOT                                         ~18     $17
         30      > JMPZ                                                     ~18, ->32
   10    31    >   ECHO                                                     'P%C5%99ipojen%C3%AD+k+DB+selhalo...'
   13    32    >   INIT_FCALL_BY_NAME                                       'mysql_select_db'
         33        SEND_VAL_EX                                              'jizdy'
         34        SEND_VAR_EX                                              !0
         35        DO_FCALL                                      0  $19     
         36        ASSIGN                                                   !1, $19
   14    37        BOOL_NOT                                         ~21     !2
         38      > JMPZ                                                     ~21, ->40
   15    39    >   ECHO                                                     'DB+not+found'
   23    40    >   ISSET_ISEMPTY_DIM_OBJ                         0          !3, 'submit'
         41      > JMPZ                                                     ~22, ->70
   24    42    >   ISSET_ISEMPTY_DIM_OBJ                         0          !3, 'from'
         43      > JMPZ                                                     ~23, ->47
         44    >   FETCH_DIM_R                                      ~24     !3, 'from'
         45        QM_ASSIGN                                        ~25     ~24
         46      > JMP                                                      ->48
         47    >   QM_ASSIGN                                        ~25     ''
         48    >   ASSIGN                                                   !4, ~25
   25    49        ISSET_ISEMPTY_DIM_OBJ                         0          !3, 'to'
         50      > JMPZ                                                     ~27, ->54
         51    >   FETCH_DIM_R                                      ~28     !3, 'to'
         52        QM_ASSIGN                                        ~29     ~28
         53      > JMP                                                      ->55
         54    >   QM_ASSIGN                                        ~29     ''
         55    >   ASSIGN                                                   !5, ~29
   26    56        ISSET_ISEMPTY_DIM_OBJ                         0          !3, 'price'
         57      > JMPZ                                                     ~31, ->61
         58    >   FETCH_DIM_R                                      ~32     !3, 'price'
         59        QM_ASSIGN                                        ~33     ~32
         60      > JMP                                                      ->62
         61    >   QM_ASSIGN                                        ~33     ''
         62    >   ASSIGN                                                   !6, ~33
   28    63        ISSET_ISEMPTY_DIM_OBJ                         0          !3, 'price'
         64      > JMPZ                                                     ~35, ->70
   29    65    >   INIT_FCALL                                               'store_drive'
         66        SEND_VAR                                                 !4
         67        SEND_VAR                                                 !5
         68        SEND_VAR                                                 !6
         69        DO_FCALL                                      0          
   48    70    > > RETURN                                                   1

Function store_drive:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jZoa7
function name:  store_drive
number of ops:  20
compiled vars:  !0 = $from, !1 = $to, !2 = $price, !3 = $date, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   19     3        INIT_FCALL                                               'date'
          4        SEND_VAL                                                 'Y-n-d+H%3Ai%3As'
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !3, $5
   20     7        INIT_FCALL_BY_NAME                                       'mysql_query'
          8        CONCAT                                           ~7      'INSERT+INTO+jizdy%28odkud%2C+kam%2C+cena%2C+datum%29+VALUES%28%27', !0
          9        CONCAT                                           ~8      ~7, '%27%2C%27'
         10        CONCAT                                           ~9      ~8, !1
         11        CONCAT                                           ~10     ~9, '%27%2C%27'
         12        CONCAT                                           ~11     ~10, !2
         13        CONCAT                                           ~12     ~11, '%27%2C%27'
         14        CONCAT                                           ~13     ~12, !3
         15        CONCAT                                           ~14     ~13, '%27%29'
         16        SEND_VAL_EX                                              ~14
         17        DO_FCALL                                      0  $15     
         18        ASSIGN                                                   !4, $15
   21    19      > RETURN                                                   null

End of function store_drive

Function get_week:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 16
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 16
Branch analysis from position: 36
Branch analysis from position: 16
filename:       /in/jZoa7
function name:  get_week
number of ops:  37
compiled vars:  !0 = $date, !1 = $result, !2 = $rows, !3 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   INIT_FCALL                                               'date'
          1        SEND_VAL                                                 'Y-n-d'
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
   35     4        INIT_FCALL_BY_NAME                                       'mysql_query'
          5        ROPE_INIT                                     3  ~7      'SELECT+%2A+FROM+jizdy+WHERE+datum+%3E%3D+%27'
          6        ROPE_ADD                                      1  ~7      ~7, !0
          7        ROPE_END                                      2  ~6      ~7, '%27'
          8        SEND_VAL_EX                                              ~6
          9        DO_FCALL                                      0  $9      
         10        ASSIGN                                                   !1, $9
   37    11        INIT_FCALL_BY_NAME                                       'mysql_num_rows'
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0  $11     
         14        ASSIGN                                                   !2, $11
   39    15      > JMP                                                      ->29
   41    16    >   FETCH_DIM_R                                      ~13     !3, 'odkud'
         17        CONCAT                                           ~14     '%3Ctr%3E%0A++++++++++++%3Ctd%3E', ~13
         18        CONCAT                                           ~15     ~14, '%3C%2Ftd%3E%0A++++++++++++++++%3Ctd%3E'
   42    19        FETCH_DIM_R                                      ~16     !3, 'kam'
         20        CONCAT                                           ~17     ~15, ~16
         21        CONCAT                                           ~18     ~17, '%3C%2Ftd%3E%0A++++++++++++++++++++%3Ctd%3E'
   43    22        FETCH_DIM_R                                      ~19     !3, 'cena'
         23        CONCAT                                           ~20     ~18, ~19
         24        CONCAT                                           ~21     ~20, '%3C%2Ftd%3E%0A++++++++++++++++++++++++%3Ctd%3E'
   44    25        FETCH_DIM_R                                      ~22     !3, 'datum'
         26        CONCAT                                           ~23     ~21, ~22
         27        CONCAT                                           ~24     ~23, '%3C%2Ftd%3E%0A++++++++++++%3C%2Ftr%3E'
         28        ECHO                                                     ~24
   39    29    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
         30        SEND_VAR_EX                                              !2
         31        FETCH_CONSTANT                                   ~25     'MYSQL_ASSOC'
         32        SEND_VAL_EX                                              ~25
         33        DO_FCALL                                      0  $26     
         34        ASSIGN                                           ~27     !3, $26
         35      > JMPNZ                                                    ~27, ->16
   48    36    > > RETURN                                                   null

End of function get_week

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.41 ms | 1411 KiB | 18 Q