尝试检索数据并存储为变量

时间:2017-05-07 17:47:31

标签: php sql sql-server database

我无法使$ firstname等于$ row ['Firstname']。与姓氏一样。

$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'];
 }

1 个答案:

答案 0 :(得分:-1)

'

前面的$locationsQuery第一行末尾,您遗漏了;