Mysql Lookup Q
Posted on 2007-07-24
I've got two Mysql tables:
ID | Value
0 | Zero
1 | One
2 | Two
And my main table, has lots of values.
Where lookup id is 1,2,3..
I'd like to be able to do a search like:
where first="bob" and lookup_id = "Zero"
Convert the lookup_id to its value, and search my main table for the lookup_id returned.
I'm pretty sure it's a standard lookup, but I don't know the syntax. Also, I'm not sure how I trap if no results come back from the lookup? What if they search for "blahblah" that doesn't exist in my lookup table?