这是我的配置文件。我使用bit-vise ssh客户端连接使用端口转发连接到我的localhost是成功的但是在查询时有500个内部服务器。
<?php
try {
$hostname = "xx.xx.xx.xx";
$port = 2351;
$dbname = "otomax";
$username = "sa";
$pw = "root";
$dbh = new PDO("sqlsrv:Server=$hostname,$port;Database=$dbname","$username","$pw"); "connect";
} catch (PDOException $e) {
"Failed to get DB handle:".$e->getMessage()."\n";
exit;
}
?>
连接成功但从服务器获取数据时出现500内部错误请帮助我
<?php
include("config.php");
$id=$_SESSION['kode'];
$sql = "SELECT * FROM dbo.reseller WHERE kode='$id'";
$query = $db->prepare( $sql );
$query->execute();
$result = $query->fetchAll( PDO::FETCH_ASSOC );
?>
请参阅此代码并帮助我