I have a SQL Server 2008 database, wich was created and is still working for a .Net application.
I have recently developed a new interface based on PHP to add new features and improve the old application.
The problem is that when the .Net application is closed, queries through PHP are very very slow, but when the .Net application is open, all queries are fast, and I have no idea of what can be happening.
I am using Laravel framework and this is one of the queries I use:
$users= DB::connection('sqlsrv')->table('users')->where('status', 'active')->get()->all();
I have also try without framework, but the result is the same:
$pdo = new PDO("sqlsrv:Server=(local)\sqlexpress;Database=db");
$query = $pdo->prepare("SELECT * FROM users WHERE status = 'active'");
$query->execute();
$users = $query->fetchAll(PDO::FETCH_ASSOC);
Regards