-1

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); 
Cœur
  • 37,241
  • 25
  • 195
  • 267

2 Answers2

1

You forget to use the ',' in $result

$result = mysqli_query($connection, $query);
Rooney
  • 26
  • 2
0

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); 
Daniel Kmak
  • 18,164
  • 7
  • 66
  • 89