In addition to our conversation (and your temporary solution waiting for the next update to solve it) about Updating Main/subtable records, I just wanted to let you know that I have already managed to submit and Insert to my database Successfully the results of my DataStore with Array fields demo here:
As you understand I’m dealing with 2 level of subTables here:
– Main (orders)
—> Subtable (order_products)
------> Subtable/Subtable (order_product_variations)
My Schema:
Now I faced again a 500 Interval error, when I’m trying to update an order…
(of course by using the same workaround as the Database Insert)
I attach my Server Action Screenshots:
I don’t have this error if I remove the 2nd level Subtable(formRepeatVariations) from the update step inside the repeat, but then no products are updated also…
So, the error i get is:
{
"code": "42000",
"file": "C:\\xampp\\htdocs\\datastore_test\\dmxConnectLib\\modules\\dbupdater.php",
"line": 294,
"message": "SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1",
"trace": "#0 C:\\xampp\\htdocs\\datastore_test\\dmxConnectLib\\modules\\dbupdater.php(294): PDO->prepare()\n#1 C:\\xampp\\htdocs\\datastore_test\\dmxConnectLib\\lib\\App.php(206): modules\\dbupdater->update()\n#2 C:\\xampp\\htdocs\\datastore_test\\dmxConnectLib\\lib\\App.php(178): lib\\App->execSteps()\n#3 C:\\xampp\\htdocs\\datastore_test\\dmxConnectLib\\lib\\App.php(146): lib\\App->execSteps()\n#4 C:\\xampp\\htdocs\\datastore_test\\dmxConnectLib\\modules\\core.php(69): lib\\App->exec()\n#5 C:\\xampp\\htdocs\\datastore_test\\dmxConnectLib\\lib\\App.php(206): modules\\core->repeat()\n#6 C:\\xampp\\htdocs\\datastore_test\\dmxConnectLib\\lib\\App.php(178): lib\\App->execSteps()\n#7 C:\\xampp\\htdocs\\datastore_test\\dmxConnectLib\\lib\\App.php(146): lib\\App->execSteps()\n#8 C:\\xampp\\htdocs\\datastore_test\\dmxConnectLib\\lib\\App.php(135): lib\\App->exec()\n#9 C:\\xampp\\htdocs\\datastore_test\\dmxConnectLib\\lib\\App.php(113): lib\\App->exec()\n#10 C:\\xampp\\htdocs\\datastore_test\\dmxConnect\\api\\orders\\order_update.php(7): lib\\App->define()\n#11 {main}"
}
And my Payload:
ord_id: 34
ord_usr_id: 1
ord_date: 2023-08-07
formRepeatProducts[0][ord_product_id]: 3
formRepeatProducts[0][ord_prd_quantity]: 3
formRepeatProducts[0][ord_prd_price]: 245.00
formRepeatProducts[0][formRepeatVariations][0][ord_prd_var_Var_id]: 4
formRepeatProducts[0][formRepeatVariations][0][ord_prd_var_Val_id]: 19
formRepeatProducts[0][formRepeatVariations][0][ord_prd_var_Val_exprice]: 10.00
formRepeatProducts[1][ord_product_id]: 7
formRepeatProducts[1][ord_prd_quantity]: 2
formRepeatProducts[1][ord_prd_price]: 32.00
formRepeatProducts[1][formRepeatVariations][0][ord_prd_var_Var_id]: 3
formRepeatProducts[1][formRepeatVariations][0][ord_prd_var_Val_id]: 14
formRepeatProducts[1][formRepeatVariations][0][ord_prd_var_Val_exprice]: 1.00
formRepeatProducts[1][formRepeatVariations][1][ord_prd_var_Var_id]: 5
formRepeatProducts[1][formRepeatVariations][1][ord_prd_var_Val_id]: 48
formRepeatProducts[1][formRepeatVariations][1][ord_prd_var_Val_exprice]: 5.00
formRepeatProducts[2][ord_product_id]: 6
formRepeatProducts[2][ord_prd_quantity]: 2
formRepeatProducts[2][ord_prd_price]: 368.00
formRepeatProducts[2][formRepeatVariations][0][ord_prd_var_Var_id]: 2
formRepeatProducts[2][formRepeatVariations][0][ord_prd_var_Val_id]: 11
formRepeatProducts[2][formRepeatVariations][0][ord_prd_var_Val_exprice]: 30.00
-
1) I remind you that the same workaround is working perfect for the Database Insert.
-
2) Of course I did the trick to open every subtable and click OK but no luck…
If you have some time to take a look at it would be very kind of you.
If you need any other information please ring my bell.
Thanks in advance