boutils 10 years ago
parent
commit
4a9d181979
1 changed files with 8 additions and 3 deletions
  1. 8 3
      ajax/oracle.php

+ 8 - 3
ajax/oracle.php

@@ -13,7 +13,12 @@
           )";
 
   // Connexion au service
-  $conn = oci_connect('ELIGIBILITE_R', 'H6nmb0KCwR', $db);
+  $conn = oci_new_connect('ELIGIBILITE_R', 'H6nmb0KCwR', $db);
+
+  if (!$conn) {
+    $e = oci_error();
+    trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
+  }
 
   // Execute query
   function executeQuery($conn, $query) {
@@ -56,8 +61,8 @@
   }
 
   // Append X,Y to results
-  $results[x] = $x;
-  $results[y] = $y;
+  $results['x'] = $x;
+  $results['y'] = $y;
 
   // Get FTTH results
   $queryFTTH = "Select FTTH.Id_Zapm_Partielle, FTTH.DATE_OUV_SERVICE_REEL, FTTH.DATE_OUV_SERVICE_PREV, FTTH.DATE_FIN_TRAV_PREV From SIG_ANT.Ftth_Mn_Zapm_Partielle FTTH WHERE SDO_CONTAINS(FTTH.GEOMETRY, Mdsys.Sdo_Geometry(2001,4326,Mdsys.Sdo_Point_Type(".$x.", ".$y.", Null), Null, Null)) = 'TRUE'";