After much thought, I think I have figured out what I am going to do. I am going to create on the first page, a place to add the hardware type, and that will add a row to the database, and create the key I need. It will then go to another page where I can enter the information, and I will have the key to be able to do the volume stuff that I want. So I would have a dropdown menu to select the type of hardware and and add hardware button only.
This would also allow me to make this front end more customizable. For instance if I have a drop down that contains workstation, server, printer, etc. I could write the code so that when workstation is selected, and I hit add, it brings up the page to enter workstation information. If I select printer, then I can enter printer information. If later I decide to add other items, even if they aren't computer related, I could with ease. If anyone see a problem with this idea, let me know. I think this would work, but I haven't started coding yet. Mike ----- Original Message ----- From: "Alberto Serra" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, July 12, 2002 10:35 PM Subject: Re: [PHP] Advice needed > Привет! > > Mike Tuller wrote: > > So I would have the progressive key inside the addvolume window? Can you > > explain how to go about doing this? > > How you organize your HTML output should *never* interfere with the way > you organize your data, they are two different things and must be kept > well separated. In a perfect world design, process flow and datamodeling > should be free to evolve without stepping into each other's way. It's > obviously impossible to fully meet this condition in the real world, but > one should always try and get as close to it as he can. > > Just do this: > > Think of your data as a temporary table, in which you have two keys: > 1) the real key, whenever available (will be blank on the stuff you > haven't written in the database yet) > 2) a progressive key, assigned by your php scripts by some means > > You just have the two keys constantly in your forms as hidden fields, so > that at process time you can still tell which is which when it comes to > relations, even if you do not have an already established relation > system (which is the case on new data). > > So: > you load your hdw components, they all have a db id already, so your > dataset will look like this: > > 1) hdw 1, its real id, your own internal key (say 1), rest of the data > 2) hdw 2, its real id, your own internal key (say 2), rest of the data > ... > > you add a new component and save the result on a temporary table, now > your temporary dataset is: > > 1) hdw 1, its real id, your own internal key (say 1), rest of the data > 2) hdw 2, its real id, your own internal key (say 2), rest of the data > 3) hdw new, no real id, your own internal key (say 3), rest of the data > ... > > You add a new volume and stock the data on a second temporary table, > which contains: > > 1) vol 1, no real id, your own hdw internal key (should be 3 since you > are adding to the last new hdw), your own internal volume id (say 1), > rest of the data > > You can repeat this step all over as much as you want (like fully > building up a number of new disks, volumes or whatever), and have it as > multilayered as you want (it will just take as many temporary tables as > are the real tables involved). > > Once your user finally reviews his/her data (say you entered a totally > new system, reviewed it and felt satisfied with it) he will have a > "fire" button somewhere. > > At this point your final script just takes the data off the temporary > tables and uses them to build the real thing. > > Notice that this way you also sort of implemented a transaction. Not a > real one, since it will not protect you if your final script fails at > runtime. Yet you can be sure no unconsistent data from unterminated > sessions will ever enter your stable datamodel, and that's were 99.99% > of the risk would come from. > > Пока > Альберто > Киев > > > @-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@ > > LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? > lOrD i'M sHiNiNg... > YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE > tHe TeSt, YeS iT iS > ThE tEsT, yEs It Is > tHe TeSt, YeS iT iS > ThE tEsT, yEs It Is....... > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php