This topic is locked

Import Children

2/8/2013 1:29:11 PM
PHPRunner General questions
G
gluckett author

Hi All,

I was wondering how to import children of a main table?
For example, if the main table is "Classrooms", I want to import the "Desks" table from excel for that one classroom?
Perhaps there is a way?
gordon

Sergey Kornilov admin 2/8/2013

I assume that Desks table has some sort of ClassroomID field that points the classroom those desks belong to. You have two options here:

  1. Specify ClassroomID in your import Excel file.
  2. Implement Import page BeforeInsert event to populate ClassroomID field automatically based on current Classroom. If these tables are related as Master-Details classroom id field will be stored in session variable $_SESSION["<table name>_masterkey1"]
    More info:

    http://xlinesoft.com/phprunner/docs/before_insert_record.htm

    http://xlinesoft.com/phprunner/docs/phprunner_session_variables.htm