神秘的MySQL错误“靠近''在第1行”

Full error message:

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

So it hasn't really told me much... Is there a way to find out more?

It has returned this message from two PHP files. Here are the first MySQL queries that I made in each file:

$query = mysql_query("SELECT * FROM `questions` WHERE `id`=".$currentId.";") or die( mysql_error() );

$query = mysql_query("SELECT * FROM `questions` WHERE `id`=".$theNextId.";") or die( mysql_error() );

There is PHP code before this though which opens the database etc.

Here is a similar problem: Link

Perhaps there an error in my concatenation?

Thanks.

$currentId is null or empty. And don't forget about SQL-injection!

Remove semicolons. The docs say "the query string should not end with a semicolon".

It seems that your final ` (back-tick) character is missing.