This topic is locked

take user directly to add page passing some reference

2/5/2009 9:08:46 AM
PHPRunner General questions
S
sawanr author

Hi,



  1. I trying to redirect user to a child table add page (quote_master_add.php). However, I want to pass quote_id along with it.
    This happens if I click on child table view link from master table list page, and then click on add new record.
    2.

    While I am on add page, can I know which ID the record is going to have or had? Does runner reserve some kind of id while adding to preserve any duplication? If yes, I want to use that ID.
    Can anyone help?

    Sawan

J
Jane 2/6/2009

Sawan,
see my answers below:

  1. master key is stored in the $_SESSION["DetailTableName_masterkey1"] variable where DetailTableName is your actual table name.
  2. no. If you use auto-increment field ID of added record is availale in the After record added event only:
    $id = mysql_insert_id();



If you don't use auto-increment field you can enter ID on the add page directly. In this case this value is available in the Before record added event:

$id = $values["FieldName"];