3v4l.org

run code in 300+ PHP versions simultaneously
<?php // variable $table_name = 'Rendisk Circular Ikea Delft'; $table = 'esync_tagshistory'; $rows = 250; $data = ""; // connect to the database $connection = mysql_connect('localhost','eSyncExport','Rendisk@2013'); mysql_select_db('esync',$connection); // sending query will collect tag names of selected ewon $result = mysql_query("SELECT ESYNC_TAGS.NAME, _date, ESYNC_TAGSHISTORY.Val FROM ESYNC_TAGSHISTORY INNER JOIN ESYNC_TAGS ON ESYNC_TAGSHISTORY.TAGID=ESYNC_TAGS.ID WHERE ESYNC_TAGS.STATIONID=1 ORDER BY _date DESC LIMIT $rows"); if (!$result) { die("Query to show fields from table failed"); } $fields_num = mysql_num_fields($result); echo "<h1>{$table_name} last $rows rows</h1>"; echo "<table border='3' cellpadding ='10' <tr>"; // printing table headers for($i=0; $i<$fields_num; $i++) { $field = mysql_fetch_field($result); echo "<td>{$field->name}</td>"; } // printing table rows while($row = mysql_fetch_row($result)) { $data = ",['".$row[1]."', ".$row[2]."]".$data; echo "</tr>\n"; echo "<td rowspan ='1'>$row[0]</td>"; echo "<td rowspan ='1'>$row[1]</td>"; echo "<td rowspan ='1'>$row[2]</td>"; //echo $data; } mysql_free_result($result); //echo "</TABLE>"; $data = "['Date', 'Value']".$data; //echo $data; ?> <html> <head> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("visualization", "1", {packages:["corechart"]}); google.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable([ <?php echo $data; ?> ]); var options = { title: '<?php echo $table_name;?>', vAxis: {title: "On/Off"}, hAxis: {title: "Time"}, seriesType: "line", series: {5: {type: "line"}} }; var chart = new google.visualization.LineChart(document.getElementById('chart_div')); chart.draw(data, options); } </script> <html> <head> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("visualization", "1", {packages:["table"]}); google.setOnLoadCallback(drawTable); function drawTable() { var data = new google.visualization.DataTable(); data.addColumn('string', 'Name'); data.addColumn('string', 'Date'); data.addColumn('boolean', 'Value'); dataata.addRows([ ['Rij 1', 'Waarde 1'], ['Rij 2', 'Waarde 2'], ['Rij 3', 'Waarde 3'], ]); var table = new google.visualization.Table(document.getElementById('table_div')); table.draw(data, {showRowNumber: true}); } </script> </head> <body> <div id="table_div"></div> </body> </html> <meta http-equiv="refresh" content="60"> </head> <body> <div id="chart_div" style="width: 100%; height: 700px;"></div> </body> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 23
Branch analysis from position: 22
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 36
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
2 jumps found. (Code = 44) Position 1 = 78, Position 2 = 49
Branch analysis from position: 78
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 78, Position 2 = 49
Branch analysis from position: 78
Branch analysis from position: 49
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 36
Branch analysis from position: 48
Branch analysis from position: 36
filename:       /in/lQVso
function name:  (null)
number of ops:  89
compiled vars:  !0 = $table_name, !1 = $table, !2 = $rows, !3 = $data, !4 = $connection, !5 = $result, !6 = $fields_num, !7 = $i, !8 = $field, !9 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Rendisk+Circular+Ikea+Delft'
    4     1        ASSIGN                                                   !1, 'esync_tagshistory'
    5     2        ASSIGN                                                   !2, 250
    6     3        ASSIGN                                                   !3, ''
    9     4        INIT_FCALL_BY_NAME                                       'mysql_connect'
          5        SEND_VAL_EX                                              'localhost'
          6        SEND_VAL_EX                                              'eSyncExport'
          7        SEND_VAL_EX                                              'Rendisk%402013'
          8        DO_FCALL                                      0  $14     
          9        ASSIGN                                                   !4, $14
   10    10        INIT_FCALL_BY_NAME                                       'mysql_select_db'
         11        SEND_VAL_EX                                              'esync'
         12        SEND_VAR_EX                                              !4
         13        DO_FCALL                                      0          
   13    14        INIT_FCALL_BY_NAME                                       'mysql_query'
         15        NOP                                                      
   14    16        FAST_CONCAT                                      ~17     'SELECT+ESYNC_TAGS.NAME%2C+_date%2C+ESYNC_TAGSHISTORY.Val+FROM+ESYNC_TAGSHISTORY+INNER+JOIN+ESYNC_TAGS+ON+%0A%09%09%09%09%09+++ESYNC_TAGSHISTORY.TAGID%3DESYNC_TAGS.ID+WHERE+ESYNC_TAGS.STATIONID%3D1+ORDER+BY+_date+DESC+LIMIT+', !2
         17        SEND_VAL_EX                                              ~17
         18        DO_FCALL                                      0  $18     
   13    19        ASSIGN                                                   !5, $18
   15    20        BOOL_NOT                                         ~20     !5
         21      > JMPZ                                                     ~20, ->23
   16    22    > > EXIT                                                     'Query+to+show+fields+from+table+failed'
   18    23    >   INIT_FCALL_BY_NAME                                       'mysql_num_fields'
         24        SEND_VAR_EX                                              !5
         25        DO_FCALL                                      0  $21     
         26        ASSIGN                                                   !6, $21
   20    27        ROPE_INIT                                     5  ~24     '%3Ch1%3E'
         28        ROPE_ADD                                      1  ~24     ~24, !0
         29        ROPE_ADD                                      2  ~24     ~24, '+last+'
         30        ROPE_ADD                                      3  ~24     ~24, !2
         31        ROPE_END                                      4  ~23     ~24, '+rows%3C%2Fh1%3E'
         32        ECHO                                                     ~23
   21    33        ECHO                                                     '%3Ctable+border%3D%273%27+cellpadding+%3D%2710%27+%0A%0A%3Ctr%3E'
   26    34        ASSIGN                                                   !7, 0
         35      > JMP                                                      ->46
   28    36    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_field'
         37        SEND_VAR_EX                                              !5
         38        DO_FCALL                                      0  $28     
         39        ASSIGN                                                   !8, $28
   29    40        ROPE_INIT                                     3  ~32     '%3Ctd%3E'
         41        FETCH_OBJ_R                                      ~30     !8, 'name'
         42        ROPE_ADD                                      1  ~32     ~32, ~30
         43        ROPE_END                                      2  ~31     ~32, '%3C%2Ftd%3E'
         44        ECHO                                                     ~31
   26    45        PRE_INC                                                  !7
         46    >   IS_SMALLER                                               !7, !6
         47      > JMPNZ                                                    ~35, ->36
   32    48    > > JMP                                                      ->73
   34    49    >   FETCH_DIM_R                                      ~36     !9, 1
         50        CONCAT                                           ~37     '%2C%5B%27', ~36
         51        CONCAT                                           ~38     ~37, '%27%2C+'
         52        FETCH_DIM_R                                      ~39     !9, 2
         53        CONCAT                                           ~40     ~38, ~39
         54        CONCAT                                           ~41     ~40, '%5D'
         55        CONCAT                                           ~42     ~41, !3
         56        ASSIGN                                                   !3, ~42
   36    57        ECHO                                                     '%3C%2Ftr%3E%0A'
   37    58        ROPE_INIT                                     3  ~46     '%3Ctd+rowspan+%3D%271%27%3E'
         59        FETCH_DIM_R                                      ~44     !9, 0
         60        ROPE_ADD                                      1  ~46     ~46, ~44
         61        ROPE_END                                      2  ~45     ~46, '%3C%2Ftd%3E'
         62        ECHO                                                     ~45
   38    63        ROPE_INIT                                     3  ~50     '%3Ctd+rowspan+%3D%271%27%3E'
         64        FETCH_DIM_R                                      ~48     !9, 1
         65        ROPE_ADD                                      1  ~50     ~50, ~48
         66        ROPE_END                                      2  ~49     ~50, '%3C%2Ftd%3E'
         67        ECHO                                                     ~49
   39    68        ROPE_INIT                                     3  ~54     '%3Ctd+rowspan+%3D%271%27%3E'
         69        FETCH_DIM_R                                      ~52     !9, 2
         70        ROPE_ADD                                      1  ~54     ~54, ~52
         71        ROPE_END                                      2  ~53     ~54, '%3C%2Ftd%3E'
         72        ECHO                                                     ~53
   32    73    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_row'
         74        SEND_VAR_EX                                              !5
         75        DO_FCALL                                      0  $56     
         76        ASSIGN                                           ~57     !9, $56
         77      > JMPNZ                                                    ~57, ->49
   43    78    >   INIT_FCALL_BY_NAME                                       'mysql_free_result'
         79        SEND_VAR_EX                                              !5
         80        DO_FCALL                                      0          
   47    81        CONCAT                                           ~59     '%5B%27Date%27%2C+%27Value%27%5D', !3
         82        ASSIGN                                                   !3, ~59
   51    83        ECHO                                                     '%3Chtml%3E%0A++%3Chead%3E%0A++++%3Cscript+type%3D%22text%2Fjavascript%22+src%3D%22https%3A%2F%2Fwww.google.com%2Fjsapi%22%3E%3C%2Fscript%3E%0A++++%3Cscript+type%3D%22text%2Fjavascript%22%3E%0A++++++google.load%28%22visualization%22%2C+%221%22%2C+%7Bpackages%3A%5B%22corechart%22%5D%7D%29%3B%0A++++++google.setOnLoadCallback%28drawChart%29%3B%0A++++++function+drawChart%28%29+%7B%0A++++++++var+data+%3D+google.visualization.arrayToDataTable%28%5B+%0A%09%09'
   59    84        ECHO                                                     !3
         85        ECHO                                                     '+%5D%29%3B%0A%09%09%0A++++++++var+options+%3D+%7B+%0A%09%09title%3A+%27'
   62    86        ECHO                                                     !0
         87        ECHO                                                     '%27%2C%0A++++++++vAxis%3A+%7Btitle%3A+%22On%2FOff%22%7D%2C%0A%09%09hAxis%3A+%7Btitle%3A+%22Time%22%7D%2C%0A%09%09seriesType%3A+%22line%22%2C%0A%09%09series%3A+%7B5%3A+%7Btype%3A+%22line%22%7D%7D%09%09%0A++++++++%7D%3B%0A%0A++++++++var+chart+%3D+new+google.visualization.LineChart%28document.getElementById%28%27chart_div%27%29%29%3B%0A++++++++chart.draw%28data%2C+options%29%3B%0A++++++%7D%0A++++%3C%2Fscript%3E%0A++%0A%3Chtml%3E%0A++%3Chead%3E%0A++++%3Cscript+type%3D%22text%2Fjavascript%22+src%3D%22https%3A%2F%2Fwww.google.com%2Fjsapi%22%3E%3C%2Fscript%3E%0A++++%3Cscript+type%3D%22text%2Fjavascript%22%3E%0A++++++google.load%28%22visualization%22%2C+%221%22%2C+%7Bpackages%3A%5B%22table%22%5D%7D%29%3B%0A++++++google.setOnLoadCallback%28drawTable%29%3B%0A%09++%0A++++++function+drawTable%28%29+%7B%0A++++++++var+data+%3D+new+google.visualization.DataTable%28%29%3B%0A%09%09data.addColumn%28%27string%27%2C+%27Name%27%29%3B%0A++++++++data.addColumn%28%27string%27%2C+%27Date%27%29%3B%0A++++++++data.addColumn%28%27boolean%27%2C+%27Value%27%29%3B%0A++++++++dataata.addRows%28%5B%0A++++++++++%5B%27Rij+1%27%2C+%27Waarde+1%27%5D%2C%0A++++++++++%5B%27Rij+2%27%2C+%27Waarde+2%27%5D%2C%0A++++++++++%5B%27Rij+3%27%2C+%27Waarde+3%27%5D%2C%0A++++++++%5D%29%3B%0A%0A++++++++var+table+%3D+new+google.visualization.Table%28document.getElementById%28%27table_div%27%29%29%3B%0A%0A++++++++table.draw%28data%2C+%7BshowRowNumber%3A+true%7D%29%3B%0A++++++%7D%0A++++%3C%2Fscript%3E%0A++%3C%2Fhead%3E%0A++%3Cbody%3E%0A++++%3Cdiv+id%3D%22table_div%22%3E%3C%2Fdiv%3E%0A++%3C%2Fbody%3E%0A%3C%2Fhtml%3E+%0A++++%0A%09%3Cmeta+http-equiv%3D%22refresh%22+content%3D%2260%22%3E%0A++%0A++%3C%2Fhead%3E%0A+++++++++%3Cbody%3E%0A%09%09%09%0A%09%09%09%09%3Cdiv+id%3D%22chart_div%22+style%3D%22width%3A+100%25%3B+height%3A+700px%3B%22%3E%3C%2Fdiv%3E%0A%09%09%09%09%0A%09%09%3C%2Fbody%3E%0A++%3C%2Fhtml%3E'
  111    88      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.65 ms | 1403 KiB | 13 Q