title: How to call oracle stored procedure at PHP using ODBC
body: <p>I am trying to call an Oracle stored procedure at a PHP website using ODBC.
  I have a table named "employees". I want to see the total employee number at the website. Below I am describing the function, procedure and pl/sql to run normally from sql. </p>
  
  <p><strong>FUNCTION:</strong></p>
  
  <pre><code>CREATE OR REPLACE FUNCTION func_totalEmployees 
  RETURN number IS
  t_emp number;
  BEGIN
          select count(*) INTO t_emp from employees;
      RETURN t_emp;
  END;
  </code></pre>
  
  <p>This function will count all entry at employees table. Then store the value at </p>
  
  <p><em>t_emp</em></p>
  
  <p><strong>PROCEDURE:</strong></p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE pro_totalEmployees(totalEmployees OUT number) 
  IS
  BEGIN
      totalEmployees := func_totalEmployees;
  
  END;
  </code></pre>
  
  <p>This procedure will run our function and output one value using <em>totalEmployees</em> variable. </p>
  
  <p><strong>PL/SQL:</strong></p>
  
  <pre><code>DECLARE
  see_totalEmployees number;
  BEGIN
      pro_totalEmployees(see_totalEmployees);
          dbms_output.put_line('Total Employees you have: ' || see_totalEmployees);
  END;
  </code></pre>
  
  <p>Now the execution part. This is just simple pl/sql query which output the total number of employees from our procedure using variable <em>see_totalEmployees</em></p>
  
  <p>That's it!</p>
  
  <p>So at sql, I got the output: <strong>Total Employees you have: 107</strong></p>
  
  <p><strong>NOW MY QUESTION:</strong></p>
  
  <p>How can I store this 107 into a PHP variable using ODBC?</p>
  
  <p>Please Help. Thanks in advance</p>