I’m trying to write a custom query to “Insert into” a SQL table. However, I’m having trouble getting the parameters to work properly. As I try to bind the post parameters to the SQL query, it’s giving me errors - see below example.
However, I can somehow make it work when there is only one parameter/binding in my custom insert SQL query - see below (the error is only there because timestamp is a required field, but it does recognise the parameter):
I’ve tried other combinations of parameters but I just can’t make the full insert query work (I do need to use a custom query for my insert, as I’m intending to nest queries).
Is this a bug, or am I doing something wrong? Appreciate any help, thanks!
Thanks @Apple. In that case “Empty” gets inserted as the value. How do I define $_POST.legal_name then? I’ve given the name “legal_name” to the Wappler text input that it relates to. This works to bind it as a parameter for a usual “Insert” query, but seems like it doesn’t for a custom query.
Thanks a lot for your help so far - it has helped narrow down the issue at least!
I’ve tried looking into the HTML and am stuck again! I even set up a very simple test page with just one input on it named legal_name - see full HTML below:
However, running this and trying to submit the form shows that the legal_name post parameter is still not coming through - see screenshot of error message below:
I’m wondering… is custom query just not set up to accept post parameters? Not sure how it could be a problem with the HTML seeing as I’ve now set up a test page with such minimal scripting (unless there is something I’ve missed of course!)
Really appreciate your help! Let me know if there is any more info/screenshots I can provide to help with troubleshooting this issue.
Seems a bit weird. Anyway, see this post in the middle, starting where it says “In your browser, open the Developer tools”:
Edit: The goal with the developer tools network tab is to see what fields your browser is sending, it’s slightly different from the screenshots in the topic above
Thanks so much @Apple! I tried again using the simplified version with a newly set up and simplified SQL table, and it worked… so it must be something to do with my existing table/HTML setup that’s causing it to not work.
Massive thanks for helping me debug it… think I can probably work it out from here by breaking it down further you’re a champ