Firstly, I have just started using phpFormGenerator and it has been tremendously helpful. But I do have one problem I can't get my head around.
I chose the mySql database option and let phpFormGenerator create the table. The form successfully writes records to it. I am however having a problem getting the Delete on the Admin Portal to work. The delete query appears to execute okay, but on refresh the record is still there. I have not edited the files in the /use/???/admin directory.
Could this be a permission problem. I am however, able to delete records in the table via a phpMyAdmin interface.
Any assistance would be greatly appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've just struggled with this same issue and this is what I did to resolve it.
All the changes were in the delete_rec.php page
1. change the pt_register('POST','id');
to pt_register('GET','id');
2. I changed the query to
$query = ("delete from $table where id=$id limit 1");
The two important things to notice in the query are that there is now one '=' sign instead of two '=='.
PHP might like two equal signs for testing equivalance but SQL gags on it.
I added the 'limit 1' to the end of the query as a safety measure. in that way a malicious user cannot delete more than one record per submission.
I hope this helps.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had the same problem. I have two instances of forms running on separate servers (purchased separately from Lunarpages and Hostgator). The code in del_rec.php removed the record as expected with MySQL on hostgator, but it did not work on Lunarpages until I changed it to what Steve suggested. Thank you and thanks for creating this very useful tool!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Firstly, I have just started using phpFormGenerator and it has been tremendously helpful. But I do have one problem I can't get my head around.
I chose the mySql database option and let phpFormGenerator create the table. The form successfully writes records to it. I am however having a problem getting the Delete on the Admin Portal to work. The delete query appears to execute okay, but on refresh the record is still there. I have not edited the files in the /use/???/admin directory.
Could this be a permission problem. I am however, able to delete records in the table via a phpMyAdmin interface.
Any assistance would be greatly appreciated.
I've just struggled with this same issue and this is what I did to resolve it.
All the changes were in the delete_rec.php page
1. change the pt_register('POST','id');
to pt_register('GET','id');
2. I changed the query to
$query = ("delete from $table where id=$id limit 1");
The two important things to notice in the query are that there is now one '=' sign instead of two '=='.
PHP might like two equal signs for testing equivalance but SQL gags on it.
I added the 'limit 1' to the end of the query as a safety measure. in that way a malicious user cannot delete more than one record per submission.
I hope this helps.
Woohoo - that solved my problem! Thank you very very much Steve.
I had the same problem. I have two instances of forms running on separate servers (purchased separately from Lunarpages and Hostgator). The code in del_rec.php removed the record as expected with MySQL on hostgator, but it did not work on Lunarpages until I changed it to what Steve suggested. Thank you and thanks for creating this very useful tool!
So simple! Thanks. I had the same problem three years after you answered this question!