Advertisement
Guest User

Make Query

a guest
Nov 20th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.31 KB | None | 0 0
  1. <?php
  2.     require 'init.php' ;
  3.     $query = $_GET["sql"] ;
  4.     $statement = oci_parse($conn, $query);
  5.     oci_execute($statement);
  6.     $rows = array();
  7.     while ($row = oci_fetch_array($statement, OCI_ASSOC+OCI_RETURN_NULLS)) {
  8.     $rows[] = $row ;
  9.     }
  10.     $json = json_encode(array('transactions'=>$rows));
  11.     echo $json ;
  12. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement