title: Oracle Stored Procedure call by PHP
body: <p>Here the code:</p>
  
  <pre><code>&lt;?php
  include_once 'config.php';
  
  // Connect to database
  $conn = oci_connect($dbuser, $dbpasswd, $dbhost."/".$dbname);
  if (!$conn) {
      exit ("Connection failed.");
  }
  
  $id   = isset($_GET['id']) ? (int)$_GET['id'] : false;
  $type = isset($_GET['type']) ? strtoupper($_GET['type']) : "BLOG";
  
  $stmt = oci_parse($conn, 
      "begin 
      PKG_LIKE.get_LikeId(
      :I_N_Id,
      :I_S_Type,
      :O_N_grade,
      :O_N_exitFlag,
      :O_S_exitMsg);
      end;");
  
  oci_bind_by_name($stmt, "I_N_Id", $id);
  oci_bind_by_name($stmt, "I_S_Type", $type);
  oci_bind_by_name($stmt, "O_N_grade", $total);
  oci_bind_by_name($stmt, "O_N_exitFlag", $flag);
  oci_bind_by_name($stmt, "O_S_exitMsg", $message);
  
  if (!oci_execute($stmt)) {
      exit("Procedure Failed.");
  }
  
  if ($message == 'OK') {
      $response = array('likeit' =&gt; $total);
      $toReturn = "var response=".json_encode($response)."; showTotalLikeit(response);";
  } else {
      $response = array('likeit' =&gt; 'NaN', 'exitFlag' =&gt; $flag, 'exitMsg' =&gt; $message);
      $toReturn = "var response=".json_encode($response)."; showTotalLikeit(response);";
  }
  
  print $toReturn;
  </code></pre>
  
  <p>Result is "Procedure Failed". Where am I failing?
  I've just used a stored procedure call (but with cursors as output) till now and all was fine.</p>
  
  <p>Launching the SP on Oracle works fine so it's a php problem.</p>