Добрый день, развернул сервер на локальной машине PHP 5.6 SQL EXPRESS 2014 установил библиотеку от microsoft для связи PHP и MSSQL создал базу в MSSQL (через скрипт Код (Text): <?php $serverName = "SPIDERSQL\SQLEXPRESS"; $connectionInfo = array("UID" => "sa", "PWD" => "Ff1f2f3f4", "Database"=>"PHP"); $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn ) { echo "Connection established.\n"; } else { echo "Connection could not be established.\n"; die( print_r( sqlsrv_errors(), true)); } /* Close the connection. */ sqlsrv_close( $conn); ?> пишет Connection established т.е. все ок а в файле config.php подключение к MySQL Код (Text): <?php //define the database connection define('DBUSERNAME', 'sa'); define('DBUSERPASSWORD', 'Ff1f2f3f4'); define('DSN', 'mysql:dbname=PHP;host=SPIDERSQL'); и если я это все заменяю на PHP: $serverName = "SPIDERSQL\SQLEXPRESS"; $connectionInfo = array("UID" => "sa", "PWD" => "Ff1f2f3f4", "Database"=>"php"); $conn = sqlsrv_connect( $serverName, $connectionInfo); ничего не происходит к базе не подключается , но и ошибок не выдает. Подскажите как исправить чтобы подключалось? в примере тот самый скрипт ( его роль считывать из базы работы и выводить в виде Gantt работ)
там после конфигурации идет файл init.php PHP: <?php namespace Bryntum\Gantt; // 4hrs ini_set('session.gc_maxlifetime', 14400); if (!session_id()) { session_start(); } require 'config.php'; function autoload($class) { $file = dirname(__FILE__).'/'.str_replace('\\', '/', $class).'.php'; if (file_exists($file)) { //echo "\n".$file; require_once $file; } } spl_autoload_register('Bryntum\Gantt\autoload'); $app = new Gantt(DSN, DBUSERNAME, DBUSERPASSWORD); if (!$app) { die('{ success: false, error : "Database connecting error" }'); } а после read.php который уже через него и читает базу PHP: <?php try { // initialize application include 'init.php'; // decode request object $request = json_decode($_GET['q'], true); $response = array( 'success' => false, 'requestId' => $request['requestId'] ); // get request parameters for the stores $storeParams = array(); foreach ($request['stores'] as $store) { if (is_array($store)) { // keep request params for the store $storeParams[$store['storeId']] = $store; } else { $storeParams[$store] = $store; } } // if calendar manager was requested for loading if (isset($storeParams['calendars'])) { // get rows $calendars = &$app->getCalendars(); $response['calendars'] = array( 'rows' => $calendars, // we return project calendar identifier in the metaData section for the store 'metaData' => array( 'projectCalendar' => $app->getProjectCalendarId() ) ); } // if resource store was requested for loading if (isset($storeParams['resources'])) { $response['resources'] = array( // get rows 'rows' => $app->getResources(), // get total number of found resources 'total' => $app->getFoundRows() ); } // if assignment store was requested for loading if (isset($storeParams['assignments'])) { $response['assignments'] = array( // get rows 'rows' => $app->getAssignments(), // get total number of found assignments 'total' => $app->getFoundRows() ); } // if dependency store was requested for loading if (isset($storeParams['dependencies'])) { $response['dependencies'] = array( // get rows 'rows' => $app->getDependencies(), // get total number of found dependencies 'total' => $app->getFoundRows() ); } // if task store was requested for loading if (isset($storeParams['tasks'])) { $response['tasks'] = array( // get rows 'rows' => $app->getTasks() ); } $response['success'] = true; // return server revision mark $response['revision'] = $app->getRevision(); die(json_encode($response)); // handle exceptions gracefully } catch (Exception $e) { $response['success'] = false; $response['message'] = $e->getMessage(); $response['code'] = $e->getCode(); die(json_encode($response)); } но в файле init.php есть строка $app = new Gantt(DSN, DBUSERNAME, DBUSERPASSWORD); которая и должна подключиться к базе , как ее можно изменить чтобы она подключилась к MSSQL?
@elfrom зная мелкософт могу предположить что нужен какой нить фикс... но скорее всего проблемма в особенностях бд а в мс я не силён((