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...
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|