Inside Array – “unidentified index” error with “prepare was called incorrectly” despite not calling the prepared statement with wordpress [closed]

Want to improve this question? Update the question so it’s on-topic for WordPress Development Stack Exchange.

Closed last month.

I know that there is a very old answer that details unidentified index but using the methods there I can not figure out how to make isset work with the code I have. It is below but doesnt solve the issue.

Plus it my error is paired with the PREPARE error AND the fact that my understanding is that answer with ISSET is NOT a safe way anymore to prevent SQL injections. Someone please correct me if I am wrong. As per request I have also included the entire error message.

I am getting a couple of errors with the code below and am not sure why it thinks this isnt prepared properly. Can anyone shed light on this for me? Thanks.

for each line that has a $POST, it is telling me that the “Notice: Undefined index”

I am also receiving a “Notice: wpdb::prepare was called incorrectly.” notice despite not having a prepare statement currently in the code. I know I need to add it.

enter image description here