1

I am new to backend developer, so this might be dumb if i am wrong in the begining.I found out that sqlsrv and mssql ways of handling db are different. For example, mssql_query can return data after db close, but sqlsrv_query cannot. For example:

$query = "select branchname, id from Branch";
$rs = $this->db->query($query);
$this->db->close();
Return $rs; 

This code can pass values to the controllers in mssql_driver ,but cannot pass to controllers in sqlsrv_driver. After i remove the db close function, it works in sqlsrv.So i think that these 2 are different.Or am i wrong? Please teach me

Zhorov
  • 28,486
  • 6
  • 27
  • 52

1 Answers1

0

You are right, can be read here -> SQLSRV->Close and here -> MSSQL->Close

The SQLSRV close method releases resourses associated with the connection and MSSQL does not.

tboom
  • 106
  • 3