3 replies [Last post]
mihirc
mihirc's picture
Offline
Leader
Pune, Maharashtra, India
Last seen: 7 weeks 12 hours ago
Pune, Maharashtra, India
Timezone: GMT+5.5
Joined: 2007-05-09
Posts: 728
Points: 204

Hello All,
Got a php question!

I am trying to select a DISTINCT entry based on a entry in the database. But when i select the entry, it only shows that current column information. It drops out all the other information related to that entry. Can anyone give a pointer? I am ready to share the username / pwd with anyone who would like to help Smile

Regards,
Mihir.

Proprietor - Thoughtfulviewfinder Services
Web Development | Design | Merchandise | Photography
My personal blog: MihirChhatre.com

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 hour 28 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9192
Points: 3197

SQL, not PHP

Your query is doing exactly what it's supposed to do. You only asked for the one distinct field.

I am no sql guru, and am fast forgetting all I ever knew. Sad You need a nested query that asks for all columns where the column of interest is distinct. If no one pops up here with an answer, you may want to try an sql forum.

I am moving this to 'off topic', as the question is not css related.

cheers,

gary

Unplanned code results in a tangled wad of brain-cramping confusion.

There are enough html & css demos and tutorials to be interesting. Please visit.

jagzviruz
jagzviruz's picture
Offline
newbie
Bangalore
Last seen: 2 years 49 weeks ago
Bangalore
Timezone: GMT-6
Joined: 2011-10-11
Posts: 6
Points: 6

your query will return all

your query will return all columns of a row based on the distinct entry.. it will be more helpful if you can share the query you are using.

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 hour 28 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9192
Points: 3197

jagzviruz wrote: your query

jagzviruz wrote:

your query will return all columns of a row based on the distinct entry.. it will be more helpful if you can share the query you are using.

Not quite. Mihir is only selecting the one field.

cheers,

gary

Unplanned code results in a tangled wad of brain-cramping confusion.

There are enough html & css demos and tutorials to be interesting. Please visit.