पहले से ही माइक्रोसॉफ्ट पर sqlsrv डाउनलोड किया एसक्यूएल सर्वर के साथ संवाद करने एसक्यूएल सर्वर के लिए Microsoft ODBC ड्राइवर 11 की आवश्यकता है ...इस विस्तार
और मेरे phpinfo() पर
php.ini
परपर सक्षमऔर C:\wamp\bin\php\php5.5.12
और अभी भी इस तरह त्रुटि मिली।
Failed to get DB handle: SQLSTATE[IMSSP]: This extension requires the Microsoft ODBC Driver 11 for SQL Server to communicate with SQL Server. Access the following URL to download the ODBC Driver 11 for SQL Server for x86: http://go.microsoft.com/fwlink/?LinkId=163712
और मेरे कोड
try {
$dbh = new PDO ("sqlsrv:Server=$host;Database=$db","$user","$pass");
} catch (PDOException $e) {
echo "Failed to get DB handle: " . $e->getMessage() . "\n";
exit;
}
$stmt = $dbh->prepare("select top 5 from teams");
$stmt->execute();
while ($row = $stmt->fetch()) {
print_r($row);
}
unset($dbh); unset($stmt);
"चालक 11"। क्या आपने जांच की है कि आपने वास्तव में कौन सा संस्करण स्थापित किया है? बस एक sqlserver ड्राइवर होने का मतलब कुछ भी नहीं है। –
@MarcB आपका क्या मतलब है? इसे कहाँ जांचें? –