tags:

views:

342

answers:

2

When I try to execute script

      PutEnv("TNS_ADMIN='C:\\Programy\\OracleDeveloper10g\\NETWORK\\ADMIN\\'");
      $conn = oci_connect(user, pass, dbstring);
      if (!$conn)
      {
        $e = oci_error();
        print htmlentities($e['message']);
        exit;
      }
      else
      {
        $stmt = OCIParse($conn, "SELECT * FROM USERS WHERE username = 'szymon'");
        OCIExecute($stmt, OCI_DEFAULT);
  while ($row = oci_fetch_array($stmt, OCI_ASSOC+OCI_RETURN_NULLS)) {
  foreach ($row as $item) {
   $password = $item;
  }
        if ($password != $_POST['password']){
          $stmt = OCIParse($conn, "EXECUTE clr_dtbs");
          $message = 'Tabele zostały usunięte';
        }
        else {
          $message = 'Podane hasło jest niepoprawne';
        }
      }
   }

I get ORA-24374 error. What is wrong with my script?

+1  A: 

Although I'm not used to (and not using) the Oracle API, does this forum post help you out?

http://codeigniter.com/forums/viewthread/103309/#521988

TheGrandWazoo
+1  A: 

Try using oci_parse instead of OCIParse. And oci_execute instead of OCIExecute.

Also, do check for error codes returned by oci_parse and oci_execute.

Pablo Santa Cruz
I changed functions as you told me. There was another problem with bracket. I took it from line 24 to 16. Another problem was with executing stored procedure. I changed the code into $stmt = OCIParse($conn, "BEGIN clr_dtbs(); END; and executed it.
szaman
In another script I changed only bracket and it worked. So only bracket was the problem...
szaman