-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
  • 34,719
  • 24
  • 185
  • 251

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
  • 17,324
  • 7
  • 67
  • 87