Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

This question already has an answer here:

For some reason it is giving me this error Parse error: syntax error, unexpected '$query' (T_VARIABLE)
code:

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

marked as duplicate by Abhik Chakraborty, Marcin Orlowski, John Conde php May 24 '14 at 12:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3  
mysqli_query($connection,$query); – Abhik Chakraborty May 24 '14 at 12:32
up vote 1 down vote accepted

You forget to use the ',' in $result

$result = mysqli_query($connection, $query);
share|improve this answer

The reason is comma that you have forgotten:

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.