How can I return Json format from Oracle using php? I did this and debugged with firebug, there were no error and it did not return anything...but it printed done!
<?php
$user = "username";
$pass = "password";
$host = "myhost/myservicename";
$conn = oci_connect($user, $pass, $host);
$sql = oci_parse($conn, "SELECT * FROM emp WHERE rownum <100");
oci_execute($sql);
$rows = array();
while($r = oci_fetch_assoc($sql)) {
$rows[] = $r;
}
$locations =(json_encode($rows));
echo 'done!';
?>