Select last record from my table I am new to SQL and PHP. I'm having a problem with selecting the last record from my table. I run the following query:

SELECT * FROM 2521118 ORDER BY id DESC LIMIT 1


My table name is 2521118 and the fields are:


id (set for auto-incrementing)
timestamp
meter_readings


Here is my error:


  Error in query (1064): Syntax error near '2521118 ORDER BY id DESC LIMIT 1' at line 1


Can someone please help me out with this?
As explained in the documentation, there are rules on what makes a valid identifier. This rule is what affects your case:


  Identifiers may begin with a digit but unless quoted may not consist solely of digits. 


So, as @ypercube says, you need to quote your table name, either with double quotes or backticks:

SELECT * FROM "2521118" ORDER BY id DESC LIMIT 1 


or 

SELECT * FROM `2521118` ORDER BY id DESC LIMIT 1