Page 1 of 1

Form Data to MySQL

Posted: Mon Jul 18, 2022 9:39 pm
by johnsmith0251
When the form data is sent to the mysql database - all the entries before it gets re-writen to the latest data that comes through. So no matter how many entires I have, they are all the same lol Any ideas?

Re: Form Data to MySQL

Posted: Tue Jul 19, 2022 3:20 am
by wwonderfull
To know what you have done we need a demo of your project. I never have issues with form data to mysql its normal.I am sure you have done something incorrect on the settings maybe that is the cause.

Re: Form Data to MySQL

Posted: Tue Jul 19, 2022 6:21 am
by Pablo
Maybe your database does not a have a primary key?
To be able to help you, I needs to know your complete setup.

Re: Form Data to MySQL

Posted: Wed Jul 20, 2022 12:51 pm
by Adrian
Hello johnsmith0251,

please check if the "ID" field of table where you want to introduce data is defined as "autoincrement".

Regards, Adrian

Re: Form Data to MySQL

Posted: Thu Jul 21, 2022 4:01 pm
by johnsmith0251
pablo & adrian - thank you! I added ID autoincrement PrimaryKey and it works.

The only wishlist item is being able to see what page the form submitted from. In advanced options, I have the "include page name/referer in form data" but it does not come through in the data base.

Any thoughts?

Re: Form Data to MySQL

Posted: Thu Jul 21, 2022 5:14 pm
by Pablo
Maybe it is blocked somewhere? For example, in the privacy settings of the browser.

The script uses standard PHP functionality:
$_SERVER['SERVER_NAME']
$_SERVER['PHP_SELF']

Re: Form Data to MySQL

Posted: Thu Jul 21, 2022 5:47 pm
by johnsmith0251
I feel silly :shock:

I can simply push through the form name lol