我想像这样使用 sql 内部连接到表:
$check_unscored = "select * from [user]
INNER JOIN [tenderrc]
on [user].[id] = [tenderrc].[userid]";
$result_unscored = mssql_query($check_unscored, $s);
while ($record_unscored = mssql_fetch_array($result_unscored))
{
$id = $record_unscored['id'];
$name = $record_unscored['name'];
$userid = $record_unscored['userid'];
$touser = $record_unscored['touser'];
$id = $record_unscored['id'];
$username = $record_unscored['username'];
$password = $record_unscored['password'];
}
我观察到两个表中都存在一个名为“id”的键名列,因此 $id = $record_unscored['id']; 将被覆盖;
我试过 $id = $record_unscored['user.id']; 但它不工作!实际上我该如何指定表名呢?