0

I have this line,

$query = "SELECT Food, Calories Title FROM 'users' ORDER BY 'ID'";

I'm so worried about my syntax, when I run it it gives me an error as,

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''users' ORDER BY 'ID'' at line 1

James Z
  • 12,209
  • 10
  • 24
  • 44

3 Answers3

1

I don't know if you've represented the line exactly as written, but your code lacks a comma after the word 'calories', as in "SELECT Food, Calories, Title FROM 'users' ORDER BY 'ID'"

Matthew Ingle
  • 117
  • 3
  • 15
0

Try: Select Food, Calories, Title FROM users ORDER BY ID

StelioK
  • 1,771
  • 1
  • 11
  • 21
-1

$query = "SELECT Food, Calories Title FROM users ORDER BY ID";

Hameed Irfan
  • 11
  • 1
  • 5