I'll try retyping them all I suppose.
^^^ Why would you go to the trouble of doing that? You must find out why the error is occurring before you can fix it. The different possibilities that have been mentioned so far are just a few of the things that could cause the symptom.
The error message is typical of an empty numerical value at the end of a query statement - i.e. where id = $some_variable, and the variable doesn't exist or is empty.
I suspect you have some authentication code, using it's own database connection, that is where the error message being displayed is coming from. The query you are posting is also failing for some reason (did you add the $link variable to the mysql_error() and mysq_errno() statements?) and is triggering the or die() logic, but the message being displayed is from a previous query that failed on the last database connection that was opened.
Another possibility is that the query that is failing is later in the code, but is not using the $query variable, and the or die() logic for it is using the $query variable and is displaying this previous query statement.
Do you have php's error reporting set to E_ALL and display_errors set to ON so that php will report and display all the errors it detects? There are likely some php errors occurring that would help pin down what and where the actual problem is at.
At this point, posting all
your code (less any database connection details), would be the quickest way of getting a solution.