Avatar of rivkamak
rivkamak
Flag for United States of America

asked on 

PDO trying to connect to a table function

I set up a simple table function in sql that returns a table

create  FUNCTION [dbo].[TorahmatesByNameEmail] 
(   
   @firstname nvarchar(50), @lastname nvarchar(50),@email nvarchar(100),@phone nvarchar(100)=NULL,@dob nvarchar(50) =NULL
)
RETURNS TABLE 
AS
RETURN 
(
      

SELECT CST_CSM_ID, ind_firstname, ind_lastname, ind_id , tel_id
   FROM CST  ......

Open in new window


In the PHP I try to use a simple query or prepare statement, and I am getting back
The active result for the query contains no fields.

try {
      $nume = $conn->query("use admire; select count(ind_firstname) from  [TorahmatesByNameEmail] ('xxx','xx','xxxxx',NULL,NULL)")->fetchColumn();
echo "<br>Number of records : ". $nume; 
...

Open in new window


Do I need to do something differently?
SQLPHP

Avatar of undefined
Last Comment
slightwv (䄆 Netminder)

8/22/2022 - Mon