DMXzone Database Updater PHP Support Product Page

Solved

using identity id of inserted record to run multiple database inserts

Reported 12 Jun 2014 06:00:40
1
has this problem
12 Jun 2014 06:00:40 Hope Tillman posted:
To learn from the video "retrieve and use the identity id of an inserted record and run multiple database actions", I have tried replicating it, but find I am only adding categories and not products.
Here is my most recent attempt:
www.msoginc.org/surname_project/identityidvideo.html

I have missed some step. Please help.

Replies

Replied 16 Jun 2014 08:48:23
16 Jun 2014 08:48:23 Teodor Kuduschiev replied:
Hello Hope,
Can you please check if your database is properly setup? I do not see anything returned for the Category ID in your table:
<tr data-binding-repeat="{{addCategory.data}}" data-binding-id="repeat1">
    	<td>{{categoryID}}</td>
    	<td>{{categoryName}}</td>
    	</tr>

The categoryID should be the unique key of your database table. It should be automatically created when you add a new record in the table.
Replied 17 Jun 2014 04:28:51
17 Jun 2014 04:28:51 Hope Tillman replied:
The categoryID is the unique key to the category table and is automatically created. When I go to the mySQL tables on the website, I see the content I have entered under both category and product. It is auto incrementing properly. But now, neither is displaying on the web page result.
Replied 17 Jun 2014 08:48:21
17 Jun 2014 08:48:21 Teodor Kuduschiev replied:
Then the issue is the way you show the data on your page. I see that you have a filter ($FORM.categoryID) on the products data source - why is that? You only need two repeat regions with no filters applied ... One for the categories and one for the products.
Replied 17 Jun 2014 16:41:27
17 Jun 2014 16:41:27 Hope Tillman replied:
Thanks, that has me part way there. Still when I click on the button ADD, the result does not display until I refresh the page.
Replied 17 Jun 2014 16:45:28
17 Jun 2014 16:45:28 Teodor Kuduschiev replied:
You just need to add a Refresh Datasource behavior on success on the product 2 executor
Replied 17 Jun 2014 17:24:13
17 Jun 2014 17:24:13 Hope Tillman replied:
Refreshing the datasource behavior on the product 2 executor worked for the Product side of the tables but not the Category. I even added a second data binding refresh to Add Category.
Replied 17 Jun 2014 17:24:13
17 Jun 2014 17:24:13 Hope Tillman replied:
Refreshing the datasource behavior on the product 2 executor worked for the Product side of the tables but not the Category. I even added a second data binding refresh to Add Category.
Replied 17 Jun 2014 21:33:41
17 Jun 2014 21:33:41 Teodor Kuduschiev replied:
Currently you set:
- Refresh category when category is added
- Refresh products when the second product is added
There is no logical reason to do this.
You need to refresh both of your datasources when the last action is executed.
Replied 17 Jun 2014 22:02:24
17 Jun 2014 22:02:24 Hope Tillman replied:
Thank you. It was very helpful to work through this.

Reply to this topic