Can’t run database query

Here issue with the column name. You are using column key in the query which is the default keyword/index in mysql.

For resolving this kind of issue just use the “Grave accent(`)’ symbol in the query for the column name, No need to change the column name. So in your case the right query is

$details = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "ch_guests WHERE `key` = '" . $id . "'", ARRAY_A);

Run the above query, This is working for me, so i believe will work for you as well.