我無法使$ firstname等於$ row ['Firstname']。與姓氏一樣。嘗試檢索數據並存儲爲變量時獲取意外的T_STRING
$locationsQuery='select Firstname, Lastname, from locations where
username=$username;
$results = sqlsrv_query($conn, $locationsQuery, array($desiredusername));
while($row = sqlsrv_fetch_array($results))
{
$firstname = $row['Firstname'];
$lastname = $row['Lastname'];
}
前,距離實際代碼這個複製/粘貼?如果是這樣,那麼在查詢後你就會錯過關閉'''。 – rickdenhaan
'$ locationsQuery'變量缺少單引號''' – Thamilan
看看突出顯示.. – chris85