How to add a column to the sql insert server side?
How to add a column to the sql insert server side?
The record is inserting just fine… but the c_id (customer id) field, which is not shown to the customer in either the form or the DataTable, is not present. I wish to add it to the sql insert.
I'm currently passing the value via the url as such:
$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
ajax: "workorder.php?c_id=1,
I could use the session to do this as well, but for testing I was attempting to use _POST.
Now I wish to include c_id
in the insert… this is where I get lost.
I tried writing to _POST['c_id']=1
, which remains null
regardless.
What method is used to add to the sql insert?
I'm not sure if this is the best method for adding variables to the insert… but I know it will work, once I know how to write to the sql insert statement.
Answers
I found this and it worked like a charm:
I also found the syntax for the where clause: