im creating a report using php and back end sql server 2005. i write the blew query this run fine in sql server while giving error when executing in php.
$query = "select distinct t1.VisitDate,t1.ReceiptNo,t1.VisitorNo,p.PatientName,STUFF((SELECT f.Particular + ', ' from CollectionPointTable t2,FeesTable f where t1.ReceiptNo = t2.ReceiptNo and f.ID=t2.TestID FOR XML PATH(''), TYPE ).value('.', 'VARCHAR(MAX)') ,1,0,'') Tests , sum(t1.payment) as Amount from CollectionPointTable t1,patientinformationtable p where p.visitorno=t1.visitorno and convert(varchar(10),t1.VisitDate,103)='$date' group by t1.Receiptno,p.patientname,t1.VisitorNo,t1.VisitDate order by ReceiptNo";
$stid =sqlsrv_query($conn, $query); $Today_patient_list = sqlsrv_fetch_array($stid,SQLSRV_FETCH_ASSOC);
that is the error which gives by Error Warning: sqlsrv_fetch_array() expects parameter 1 to be resource, boolean given in C:\wampnew\www\logs\viewTodaysCollection.php on line 65
Aucun commentaire:
Enregistrer un commentaire