greetings to all.
i need a guide or help..
current situation i have two table in database
first table - abbreviate
data field - words1 and key1
PK - words1
second table - full_word
data field -words2 and key2
PK- key2
what i just need is to show words2 from table full_words but the input will read from the words1...
how i want to relate this two table??
example:
table : abbreviate
words1 = NY
key1 = 12
table: full_word
words2 = New York
key2 = 12
if user key in value NY there will show New York as output.
or any suggestion link to look up?
Perhaps some SQL expert will come along, but in the meantime I think you need to do this in 2 steps . . .
get a variable that is the key when the user types in NY
then use that variable to get the name of the state.
something like this (I'm sure this is not quite right, but should get you somewhere)
so i just need to declare first then set the attribute??
actually that just an example...
what actually i'm doing...
the key for abbrev because there are a lot kind of abbrev word
so i just make the key to determine with one value..
the relationship like many words abbrev have one meaning (M:1)..
okies...so i just need only one table with two column right??if i want PK for the abbrev just make the column autoincrement??
ok i'll try to do this way...
many thank's...^^
sorry again...may i ask..
i'm doing just like u said...one table with abbrev column and meaning column...
but i have the problem where the data only read one word..
for example...
input --> hv b4u
but the output only read "before you" only..."have" word did not retrieve..
i'm using sql statement SELECT meaning FROM table WHERE abbrev = abbrev_words;
should i use UNION ALL or other way to retrieve the data from same table?
WHERE hv = abbrev_words OR b4u = abbrev_words
i have a lot of abbrev word...
so if i'm using that way its means there are a lot of sql statement...
I guess that all depends on how many inputs to the sql you have doesn't it.
If the person searches for 50 abb then you have to search for 50
If they search for 1 then only 1 is required.
ouh ok. understand.
many thanks...^^
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)