How to solve Mysql PDOException: SQLSTATE[42S02]: Base table or view not found:
Remove the 'drup_' prefix from your db_query call. Since you define a prefix in settings.php, using {Detailstable} will automatically add the prefix on lookup.