Data not saved in Database

Fredolino 25 Mar, 2019
Hi,
I want to store data in the database table via a form in the frontend.
The data from the text fields are saved. 2 data is not saved.

In the text box I have:
Name: Article [gemeinde]
Value: {var: read_data19.Article.gemeinde}

In Save Data:
Write action: Insert
Data provider: {data: Article}

Data override on insert:
createddate: {date: Y-m-d H: i: s}
createdbyuser: {user: id}

Data override on update:
modified: {date: Y-m-d H: i: s}
ModifiedBy: {user: id}

The value from the input field "gemeinde" is not stored in the database.
The value "createdbyuser" is also not saved correctly. Only one "0" is saved.
The "createdbyuser" column must normally contain the ID of the user.

Does anyone have a tip for me?

Many thanks for the help.
F.


​[file=11828]screen.png[/file]
Max_admin 25 Mar, 2019
Hi Fred,

You can use a debugger after the "Save data", it will show you first the values coming from the "data provider" and those in the "data override", if the values are not available in the first array then you have a problem in the provider/fields names..etc

But if they are ok, then they are not available in the 2nd array after SQL then its a problem with the table fields not available or wrong type..etc

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
healyhatman 25 Mar, 2019
Answer
Just put the fields in manually.
gemeinde:{data:Article.gemeinde}
Using the data source option of the save data action means the fieldnames in the database have to be exactly the same as the fieldnames in the data source array.

And if {user:id} is 0 then that's a guest user that's not logged in. But try {user:id} instead of {user: id} (as in - no spaces)
Fredolino 26 Mar, 2019
Hi,

many thanks for the help. :-)

I used it once for the test:
community: {data: Article.gemeinde}
The entry was made in the database.
Then I entered the correct code again and suddenly it was saved to the database. Although I did not change anything at night.
No matter, the main thing is it works.

The tip with the "guest" was right. Of course, I first have to make the Joomla post with the form not public, so that the user logs in before.
Now it works too. :-)

Many Thanks!!
F.
This topic is locked and no more replies can be posted.