PHP使用xampp解析错误:语法错误,意外'$ query'(T_VARIABLE)

时间:2014-05-24 12:31:28

标签: php sql

出于某种原因,它给了我这个错误解析错误:语法错误,意外'$ query'(T_VARIABLE)
代码:

$query="SELECT * FROM posts, users 
WHERE posts.userID = users.userID ORDER BY postTimestamp";          
$result = mysqli_query($connection $query); 

2 个答案:

答案 0 :(得分:1)

你忘了使用','在$result

$result = mysqli_query($connection, $query);

答案 1 :(得分:0)

原因是您忘记了逗号:

$query="SELECT * FROM posts, users 
WHERE posts.userID = users.userID ORDER BY postTimestamp";          
$result = mysqli_query($connection, $query);