That is my issue, you're right.
I tried adding that piece of code where my queries are executed, but upon submission, I received a blank, white page. I can't give you an error because error reports are off.

Perhaps I need to do what this person did?
https://vborg.vbsupport.ru/showthread.php?t=231389
He said he needed to include fetch_js_safe_string.. how could I do that? Is that needed?