Couple things in the scripts you just posted. First - and I have to assume this has to do with copy/paste into the post editor here - all your double quotes are fancy quotes, and that's throwing an error. I don't know what IDE you're using, but if it's formatting text that's going to be an issue - try VSCode or even Notepad++.
Second, you don't ever actually echo out $qry
in your second script, so nothing gets returned to $return
in your first.
Lastly, I don't know what 'forms/incl/config.php' looks like, but I assume if it wasn't working you'd see your error message in $return
, so it should be good.
I ran your scripts (without the include) here, and once $qry
was echoed in the second script, everything worked as expected. Turn on error reporting and see if there's anything else throwing a notice or an error.