- Joined
- Jan 19, 2007
- Posts
- 2,207
- Reaction score
- 47
I have a table where there are a bunch of fields. I'm trying to extract information for rows with a unique 'code' where subject='subject'. I also need the 'title' field entry from that row.
Here's my query:
$query="select distinct(code), title from tablename where subject='$subject' order by code asc";
Is this correct or can it cause problems that of the 2 variables I'm pulling, I'm specifying 1 as disctinct?
Here's my query:
$query="select distinct(code), title from tablename where subject='$subject' order by code asc";
Is this correct or can it cause problems that of the 2 variables I'm pulling, I'm specifying 1 as disctinct?