简单PHP代码中引发的T_Variable错误

时间:2017-02-01 04:30:40

标签: php sql

在运行在线数据库上托管的PHP代码时,我一直收到T_Variable异常。我不是PHP的专家,但也许你们中的一个人可以发现错误。

感谢,

以下是代码:

$wind = "deep34"; //error thrown here. When I delete this variable. //Error jumps to $name
$name = "6";  

$sql = "select *from students where deviceid = '$name' and alpha = '$wind';";

1 个答案:

答案 0 :(得分:0)

请勿在声明末尾使用分号

$sql = "select * from students where deviceid = '$name' and alpha = '$wind'";