I have a problem with ajax answer. My test php file contents look like this:
<?php $values = array('value'=>'123', 'key'=>'Test' ); echo json_encode($values); ?>
And everything works fine. But the problem is when I try to include the database connection file, and then the response stops.
Basically, if I add require_once 'database.php'; Connection file contents:
<?php $login = new PDO("sqlsrv:Server=SERVER;Database=db", "login", "pass"); ?>
I already tried using
ini_set('display_errors', 1); error_reporting(E_ALL);
but nothing. This connection is excellent, the file location is also excellent. And work with another site.
The contents of the test.php file:
<?php ini_set('display_errors', 1); error_reporting(E_ALL); require_once 'database.php'; $values = array('value'=>'123', 'key'=>'test'); echo json_encode($values); ?>
database.php file in the right place.
source share