Hi All,

I am working on an application that uses a Primary Key 'ID'.  This ID
is based on Table A.  Another portion of this application needs to use
the  ID for Table B.

My question is how would I pass that ID (from Table A) in a form to a
newly added item in Table B?  I was thinking of this.  I have one form
that the user selects the 'Vendor' (Table A), then that posts to
another form 'addPart' (Table B), but I have not figured out how to
get the Vendor ID to the Part Form.

//selects a vendor to the database
function add()
    {
                $this->set('vendors', $this->Vendor->findAll());
    }

//Adds the part to database.
        function addPart()
    {

                if (!empty($this->data))
        {
                        $this->$id = $_POST["id"]; //tried this to get ID
            if ($this->Part->save($this->data))
            {
                        $this->Session->setFlash('You have added a new part
successfully.');
                        $this->redirect('/parts/index');

            }

        }


    }


This is obviously a new guy question, but I have searched all over the
place and could not find a clear answer. Any help would be
appreciated.  Thank you!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to