php json_encode fails without error

PHP Version: 5.6.15RC1
Compiler: MSVC11 (Visual C++ 2012)
Architecture:x86

I am having problem json_encode ing a multi dimensional php array.
The main problem is that no error is generated (json_last_error=0).

The array is indexed by a string and testing each of these indexes seperately has been done within the array compilation has been done on the outer indexes by using:

$test = json_encode($account[$q_id]);
if (strlen($test) < 2) {
    $error = json_last_error();
}

Stepping through several showed correct json output. Then a breakpoint in the if statement was placed to identify any encoding issues, however it never stopped on the $error… line.

Database connection:

$connection_cfg = array("Database" => $db["database"], "CharacterSet" =>     "UTF-8", "UID" => $db["uname"], "PWD" => $db["pword"], "ReturnDatesAsStrings" =>true);
$this->connection = sqlsrv_connect($db["host"], $connection_cfg);

I am stuck on how to proceed to debug this.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s