Hi,
I'm building an android app to update a stock keeping system so that it can be used on the shop floor.
The UI for web is built with fabrik and so is the database.
The app works like this;
Using 2 fabrik tables in the database 'parts' and 'jobrecords'
The user scans a QR containing a unique identifier from the parts table and the app returns some fields 'part name', 'description', 'quantity in stock'.
Then the app gives the user the option to add a part from the parts list to the job record.
The app needs a php file to run mysqli queries to manipulate or lookup data in the database.
When the user adds a part to a job the part quantity is subtracted from 'quantity in stock' on the parts list like this;
That part is straight forward enough.
But I'm not sure how to add the part to the job record as parts used on job records are a repeating group.
I see in the database fabrik adds each item of a repeating group into a new table like
jobrecords_repeat_101
jobrecords_repeat_102
etc.
I don't know how to do that with a php mysql query, can anyone help me understand how fabrik is adding these repeats to the database or what query I would need to run to add these repeat rows to the database?
Marc
I'm building an android app to update a stock keeping system so that it can be used on the shop floor.
The UI for web is built with fabrik and so is the database.
The app works like this;
Using 2 fabrik tables in the database 'parts' and 'jobrecords'
The user scans a QR containing a unique identifier from the parts table and the app returns some fields 'part name', 'description', 'quantity in stock'.
Then the app gives the user the option to add a part from the parts list to the job record.
The app needs a php file to run mysqli queries to manipulate or lookup data in the database.
When the user adds a part to a job the part quantity is subtracted from 'quantity in stock' on the parts list like this;
PHP:
$sql = "UPDATE table_parts SET instock -'$qty' WHERE partno='$partno'";
That part is straight forward enough.
But I'm not sure how to add the part to the job record as parts used on job records are a repeating group.
I see in the database fabrik adds each item of a repeating group into a new table like
jobrecords_repeat_101
jobrecords_repeat_102
etc.
I don't know how to do that with a php mysql query, can anyone help me understand how fabrik is adding these repeats to the database or what query I would need to run to add these repeat rows to the database?
Marc