This topic is locked

pulling fields from other tables onto the edit page

8/30/2006 3:34:17 AM
PHPRunner General questions
T
thesofa author

Hi

I have a database of 7 tables, one master table holding all the transactions and 6 tables used for lookups.

When I try to edit a record, the record displays as the numbers held in the master table, these numbers are ID numbers for all the detail held in the lookup tables.

I would like to be able to show the detail from the lookup tables on the edit page for the main table.

I have tried including the fields I need to make the teacher and pupil names from the teacher and pupil tables, all that happens when I come to save the record is a 256 error
what I need to do is open the record for editing, set some empty field values to be the same value as some of the existing fields in the same record.

I then need to look for the value of one field in another table, get the associated record in the second table, retrieve the data from a different field in that record and look in a third table for the value I extracted from the second table. Once I have found the record in the third table, I need to extract the value of the index for that record and set it to be the value of the record I first opened.

I have tried to fiddle with saving old data in another table event, I have tried looking up values in another table, and boy, I am now really stuck and September 4 approaches.

I could do with some more of this forum's good help please.

J
Jane 8/30/2006

Hi,
as I understand you want to edit joined fields on the EDIT page.

You need to edit SQL query on the Edit SQL query tab.

Please read more info here:

http://www.xlinesoft.com/articles/search_s...okup_values.htm

T
thesofa author 8/30/2006

Hi,

as I understand you want to edit joined fields on the EDIT page.

You need to edit SQL query on the Edit SQL query tab.

Please read more info here:

http://www.xlinesoft.com/articles/search_s...okup_values.htm



Thanks for the link, it seems to dio most of what I want.

Will I get commonfunctions.php with version 3.0 build119?
The second half of the question deals with my need to set the value of a field [aa] in the view to be equal to the present value of a different field [bb] in the same view. I then wish to give the field [bb] a different value.

I also need to change the value of a field[cc] from "S" to "D".

I also have to retrieve the values from another table using the value in field [dd] as the link criteria, then I have to take a different field from the row in [dd] and enter the value in field [ee] in the first view.

Then i want to save the values.
I have tried using the events, but I seem to be picking the wrong events, please can you point me in the right direction for this, I realise it is more than one thing at a time, but it is all linked together in my head ATM
Cheers

J
Jane 8/30/2006

Hi,
se my answers below:

  1. you need to edit include/dbcommon.php file. This article is for PHPRunner 3.1.
  2. use Before record updated event for your purpose.

    You need to combine some actions and write new code.

    For that you should be familiar with PHP.

    Here are some PHP tutorials:

    http://www.webcheatsheet.com/php/

    http://www.w3schools.com/php/default.asp

    http://ru.php.net/tut.php