![]() |
|
| Domain Name Sales | Domain Software | Calculate UK Domain Drop Dates | Domain Registration | NameDrive | Domain Parking | Subscribe to our Domains For Sale newsletter |
| | ||||||
| Home | Register | Rules | Membership Upgrade | Domains For Sale | Domain Name Escrow | Mark Forums Read | Domain Classified | Chat Room |
| Scripts and Coding PHP, MySQL, scripts |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
![]() | php query
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?
__________________ Connect with me @ TW:LI:FB | MyWeb | D/L domains4sale | Morecambe London Student Forums Student Books UK promotions agencies |
| |
| | #2 (permalink) |
![]() |
theoretically if you ask the puritans your not supposed to pull more than one column when specifying distinct. As your using orderby the distinct you may wanna alias it and set distinct code as distcode then order by distcode, otherwise some SQLs will order by all the code not just the distinct ones. (there maybe 1000 code lines but only 15 distinct ones). I personally think if it works then its ll good
__________________ Browse: |
| |
| | #3 (permalink) |
![]() |
__________________ LowPrices.co.uk | My Twitter | KeyphraseDomains.co.uk | Mens Shirts | Hotels in Bath | Money Off Code |
| |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Domain Name Community | Replies | Last Post |
| PHP include in a Smarty Template | admin | Scripts and Coding | 1 | 13-05-2008 06:37:26 AM |
| PHP Builder | admin | Scripts and Coding | 1 | 02-12-2007 08:18:08 AM |
| PHP help | admin | Scripts and Coding | 0 | 17-11-2007 03:11:05 PM |