Jump to content

Form variables, server variables, confusion and problems....


Recommended Posts

Hi all:

I'm new to the forum and also new to PHP.  Please bear with me if this is the dumbest question ever.  I am writing a modest corporate database application via Dreamweaver to keep track of units in inventory.  I've configured the testing server (LAMP) and set up an entry page to where items can be added to the database through the web browser.  Now some items have one or more associated items (options or accessories) which are in a separate table.  I want to link the two tables with what I understand to be the classic RDBMS method: a common key.  This common key is furnished in the "unit_id" column of my "units_main" table, where a unique, auto-generated integer is assigned to each item.  The same column exists in my "di_options" table, only not as the primary key, so duplicate entries may be made. 

Sorry if this is getting long-winded.

Now after entering the primary data for the unit, I want to proceed immediately to a screen where I can add records for accessories to the "di_options" database, linked to the unit I just created by the unit id.  Now this would not be a problem if this unit id were user-generated.  The user could simply enter the unit id of the unit he just created by hand from memory (awkward, of course, but doable).  However, since the unit id is auto-generated (there isn't even a box on my form to enter it), the user has no way of knowing it without backing up to the inquiry screen and looking it up!  I know there must be a way to carry over the auto-generated user id from the record into the form on the accessory entry page.  I have tried to do this using variables... but as I tried to write down my logic for that just now, it fell apart.

So, does anyone know how to carry over an auto-generated key from a record just created into a form?

If so, thanks.

Ken Quad
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.