Hello, I hope you can help me. Thank you
Technologies used:
DOCTRINE 2.4.*/ PHP 5.3.0/ SQL SERVER 2000/ XAMPP 1.7.2
The SQL Server 2000 is installed on Windows 2003 Server.
This web application on a computer with XAMMP and windows 7 32bit.
To connect to the database sql server 2000 I need the driver sqlsrv2.0 and
install windows 2008 native client 32 bits. For this, I add in the file
php.ini:
extension=php_sqlsrv_53_ts_vc9.dll
extension=php_pdo_sqlsrv_53_ts_vc9.dll
Now, when I run phpinfo() shows me sqlsrv pdo drivers.
When I query the database in an error occurs. The connection to the database is
ok. When I use the method find () it works.
citas.php
<?php
require_once "../doctrine/bootstrap.php";
$query = $entityManager->createQuery('SELECT c FROM Cita c WHERE
(c.CodigoCita>?1)');
$query->setParameter(1,100);
$citas = $query->getResult();
echo count($citas);
Error:
br />
<b>Fatal error</b>: Uncaught exception 'PDOException' with message
'SQLSTATE[IMSSP]:
The connection cannot process this operation because there is a statement
with pending results.
To make the connection available for other queries, either fetch all
results or cancel or free the statement.
For more information, see the product documentation about the
MultipleActiveResultSets connection option.'
in
C:\xampp\htdocs\HistoriaRedonda\doctrine\vendor\doctrine\dbal\lib\Doctrine\DBAL\Connection.php:694
Stack
trace:
#0
C:\xampp\htdocs\HistoriaRedonda\doctrine\vendor\doctrine\dbal\lib\Doctrine\DBAL\Connection.php(694):
PDOStatement->execute()
#1
C:\xampp\htdocs\HistoriaRedonda\doctrine\vendor\doctrine\orm\lib\Doctrine\ORM\Persisters\BasicEntityPersister.php(748):
Doctrine\DBAL\Connection->executeQuery('SELECT t0.Codig...', Array,
Array)
#2
C:\xampp\htdocs\HistoriaRedonda\doctrine\vendor\doctrine\orm\lib\Doctrine\ORM\Persisters\BasicEntityPersister.php(829):
Doctrine\ORM\Persisters\BasicEntityPersister->load(Array, NULL, Array)
#3 C:\xam in
<b>C:\xampp\htdocs\HistoriaRedonda\doctrine\vendor\doctrine\dbal\lib\Doctrine\DBAL\DBALException.php</
b> on line <b>91</b><br />
Connection.php:694Stack:
public function executeQuery($query, array $params = array(), $types = array(),
QueryCacheProfile $qcp = null) { if ($qcp !== null) { return
$this->executeCacheQuery($query, $params, $types, $qcp); } $this->connect();
$logger = $this->_config->getSQLLogger(); if ($logger) {
$logger->startQuery($query, $params, $types); } try { if ($params) {
list($query, $params, $types) = SQLParserUtils::expandListParameters($query,
$params, $types); $stmt = $this->_conn->prepare($query); if ($types) {
$this->_bindTypedValues($stmt, $params, $types); line 694 $stmt->execute(); }
else { $stmt->execute($params); } } else { $stmt = $this->_conn->query($query);
} } catch (\Exception $ex) { throw
DBALException::driverExceptionDuringQuery($ex, $query,
$this->resolveParams($params, $types)); }
$stmt->setFetchMode($this->defaultFetchMode); if ($logger) {
$logger->stopQuery(); } return $stmt; }
public function executeQuery($query, array $params = array(), $types = array(),
QueryCacheProfile $qcp = null)
{
if ($qcp !== null) {
return $this->executeCacheQuery($query, $params, $types, $qcp);
}
$this->connect();
$logger = $this->_config->getSQLLogger();
if ($logger) {
$logger->startQuery($query, $params, $types);
}
try {
if ($params) {
list($query, $params, $types) =
SQLParserUtils::expandListParameters($query, $params, $types);
$stmt = $this->_conn->prepare($query);
if ($types) {
$this->_bindTypedValues($stmt, $params, $types);
line 694 $stmt->execute();
} else {
$stmt->execute($params);
}
} else {
$stmt = $this->_conn->query($query);
}
} catch (\Exception $ex) {
throw DBALException::driverExceptionDuringQuery($ex, $query,
$this->resolveParams($params, $types));
}
$stmt->setFetchMode($this->defaultFetchMode);
if ($logger) {
$logger->stopQuery();
}
return $stmt;
}
Introducir código aquí...
bootstrap.php:
<?php
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
require_once 'vendor/autoload.php';
$isDevMode = true;
$conn = array(
'driver' => 'pdo_sqlsrv',
'host' => '192.168.1.6',
'dbname' => 'MedicosCopia272015',
'user' => 'XXX',
'password' => 'XXXXXXXXXX',
'MultipleActiveResultSets' => false
);
$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__."/src"),
$isDevMode);
$entityManager = EntityManager::create($conn, $config);
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.