"$result=mysql($DBName,SELECT * FROM Users WHERE User='$UID'); does not return a valid mysql result list, i.e. something went wrong on the way querying the database." . . . .