5 Replies Latest reply: Dec 17, 2012 4:55 PM by cj RSS

    Why odbc_exec always fail?

    980172
      Hi all.
      I have this code, the connection always works well, but when executing odbc_exec() its always give me a "error" for all sql commands.I am connecting with DBA privileges. In my php page i always get a warning "Warning: odbc_exec()" but no reason is specified.

      ....
      $c = odbc_connect(service_name, user, password);
      if (!$c)echo 'Failed to connect';
      $sql= "SELECT * FROM Medics";
      $result = odbc_exec($c,$sql) or die("error");
      ...

      Anyone knows what is happening here? Thank you.

      Edited by: 977169 on 16/Dez/2012 11:02