I have the following scenario. There are two tables, they are related in by the foreign key displayed in italics.
| Table 1</b |
| table1ID | int |
| table1desc | varchar(20) |
|
| Table 2</b |
| table2ID | int |
| table2desc | varchar(20) |
| table1fk | int |
|
As you may have noticed,
Table 2 contains the foreign key to
Table 1, which is an intenger value (for the Autoincrement field in table 1).
table1desc is really the value that matters for the user. It is the value that the user sees and selects when I display the pull-down menu in HTML and populate it with the contents of
Table 1.
So my problem is as follows. When I display the list of values to the user I am forced to do so by displaying the foreign key value next to the description value in pairs(table1desc). Then, when the user submits the form, a script splits the values pairs to extract the foreign key, which is an integer.
I would like to know if there is a way to hide this value from the user without having to alter the table structure to make the description value (table1desc) the primary key. This is all because I don't want the user to see the value of the primary key of Table 1.
Thanks...
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.