2015-05-17 73 views
1
<?php 
include 'config.php'; 
$query = sqlsrv_query($conn1, "SELECT * FROM dnmembership.[dbo].DNAuth a JOIN dnworld.[dbo] Characters b ON a.CharacterID = b.CharacterID where a.CertifyingStep = 2"); 

while($row = sqlsrv_fetch_array($query,SQLSRV_FETCH_ASSOC)){ 
echo $row['CharacterName']. '<br/>'; 
} 
?> 

這段代碼獲得滿足folllowing錯誤代碼: 警告:sqlsrv_fetch_array()預計參數1是資源,布爾在C中給出:\ XAMPP \ htdocs中\上線usersonline.php 5從SELECT語句循環結果拋出錯誤

任何人都知道爲什麼?

回答

0

[dbo]Characters之間缺少一個週期(.):

SELECT * 
FROM dnmembership.[dbo].DNAuth a 
JOIN dnworld.[dbo].Characters b ON a.CharacterID = b.CharacterID 
------------- Here -^ 
WHERE a.CertifyingStep = 2