troubleshooting Question

PDO trying to connect to a table function

Avatar of rivkamak
rivkamakFlag for United States of America asked on
9 Comments1 Solution27 ViewsLast Modified:
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

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?
Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros