From a quick look at your code, none of these variables are defined. You will need to assign the property from the entry to your $RoleDate, $Roleuser, $Roleid and $Roleip variables. Right now, if you have debugging on, you would likely get betting ‘undefined’ warnings. The code will continue, but it won’t do what you want it to.
Once you have enabled logging, it’s time to add your own logging statements to your own code, to see if your variables hold the values you expect them to, and your function calls are returning the correct values.
If you have any questions about setting up the custom logging, please let us know.
Understood.
As an experiment I have deleted/blanked those variables from the code so the it reads as below. It worked. Had to hard code the id field as its a primary key in the table, so it is not a final solution but at least its writing to the table. Had to delete the reference to the prefix so that table name is simply “CWRoles”. I do need to find a way to include the blanked out variables as they represent: (1) the date (and time) when the form entry was submitted(created_date), (2) the (id) of the entry form submission ( I guess this is set post submission) , (3) the (user) who submitted the form; and (4) , the user’s (ip). I guess there is a way of grabbing those values as they are stored somewhere? Maybe I have a work around by using the Perk I have installed ‘Populate Anything’ . I suspect I’ll still need a PHP snippet to define the submission id value post submission of the form.
So that all populates fine. My only issue now is that I am using WpDatatables and their GF Integration Add-on. With this I am able to edit and delete the GF entries. Trouble is that if then edit or delete a previous GF entry it changes the GF entries and the WPDatatable on my site but my code snippet does not handle feeding that delete/edit in the CWRoles table. I’m obviously going to have to add some more PHP to reflect any edits or deletions in the table CWRoles. I’m getting there in steady steps. Hopefully there is a php post submission function that will enable me to pass an edit/deletion.
Therefore, I’ve solved my original problem. Now I have a new one to fix!
Thanks for your initial help/comment. It set me on the right path.
How can I reflect Edits and Deletes through to my separate table? I can edit and delete GF entries from the front end via WPDatatables + Gravity Integration. I understand the modal for the deletion and edit is from the Gravity side? Therefore I am interested to know if there are any hooks that can help me to pass any all edits and deletes to my separate sql table of entry data?