This topic is locked

how to import child records

9/23/2023 4:20:20 PM
PHPRunner General questions
W
wfcentral author

I'm posting this even though I found some info by searching the forum. That info was from many years ago prior to v9.7 when session variables were changed... so, those fixes were not working.
I'm trying to import students.
I have two tables.
rosters
students
the info I found in the forum said to use the following code in Import before Insert Record
$values['roster_ID'] = $_SESSION["<table name>_masterkey1"];
when I change that to
$values['roster_ID'] = $_SESSION["rosters_masterkey1"];
it does not work. It is inserting blank for that field.
I can see the value I need in the URL https://www.mywebsite.com/class/student_list.php?mastertable=rosters&masterkey1=5767&a=return

Sergey Kornilov admin 9/24/2023

You should be using the recommended API: getMaterRecord()
https://xlinesoft.com/phprunner/docs/getmasterrecord.htm

fhumanes 9/25/2023

Hello,
If you have programming experience, I think this article can inspire you to solve exportations and data imports from different tables.
https://fhumanes.com/blog/guias-desarrollo/guia-54-utilizacion-de-ficheros-zip-para-transportar-contenidos/
All the best,
fernando