Results 1 to 5 of 5
Thread: Query driving me nuts
Sep 10, 2013, 05:34 #1
- Join Date
- Jul 2013
- South of the equator, then turn left
- 0 Post(s)
- 0 Thread(s)
Query driving me nuts
I have a query which retrieves information from 2 tables. My WHERE statement receives its value from a URL on another page:
WHERE fname = '$name' ";
Instead of using a primary key (e.g., name_id = 1) in my query and URL, I've used another column's name – fname, in order to make the URL easier to read. The problem however, is that by using a column that's not a primary key, I'm unable to a access the specific rows in my “child” table (primary - foreign key relationship).
So, should I rather use 2 key-value pairs in my query and URL, instead of what I'm currently doing?
WHERE fname = '$name' && name_id='$nameid'”;
Or is there a simpler way or perhaps I'm missing something?
Please let me know.
Thanks in advance!