| Index
» Projects
» phpMyEdit
» Forum
» Using distinct |
 |
d34d
Joined: 19 Apr 2004
Posts: 3
Posted: 2004-04-19 17:44
Back to top
Reply with quote
|
I have a simple mysql table built for simple low risk profiling, it includes usernames, and then profiles. However I have a Leaders and then Followers all in the same table, the Leaders use some columns that Followers dont.
How would I be able to get this to distinctly just show the Leader data. I got it to where it will show the opt lists I want, but it will show white space because of the select * query. I needa select distinct.
Sorry if this is a newbie question, but I'm new to this myself.
|
michal
Joined: 17 Jun 2003
Posts: 537
Location: Slovakia
Posted: 2004-04-19 18:15
Back to top
Reply with quote
|
well the easiest way is to have two files, separate for leaders and followers.
for leaders
| Code: |
$opts['filters'] = "type = 'leaders'";
|
(or how you tell difference between leader and follower)
and standard configuration of $opts['fdd'].
for followers: it will be similar.
make sure that adding is correct in both leaders and followers.
|
d34d
Joined: 19 Apr 2004
Posts: 3
Posted: 2004-04-19 19:33
Back to top
Reply with quote
|
perhaps I'm just not explaining myself, pardon my newness.
I want the phpmyedit to produce this
sql=("select distinct * from info where leader='$var'");
|
michal
Joined: 17 Jun 2003
Posts: 537
Location: Slovakia
Posted: 2004-04-19 21:00
Back to top
Reply with quote
|
pme is doing 'select col1 as col1, ... from table where ..'
it's not doing '*'.
and to make 'select distinct ..' ( not 'select ..') is possible only (afaik) through hacking the main class.
btw, what does 'distinct' do ? (my sql class was a long time ago ...)
|
d34d
Joined: 19 Apr 2004
Posts: 3
Posted: 2004-04-19 21:17
Back to top
Reply with quote
|
Never mind I finally figured it out. I'd been working with phpmyedit for a few days and hadn't been able to accomplish much. Being a very novice programmer I just had to figure out how to turn my mysql queries into what it wanted.
The only thing I'm having issues with now is I've found that $opts['filters'] justifies your where statement. I cant figure out what would justify your select statement.
|
michal
Joined: 17 Jun 2003
Posts: 537
Location: Slovakia
Posted: 2004-04-23 13:34
Back to top
Reply with quote
|
you modify you $opts['fdd'] which says which fields are to be displayed. delete entries which you don't want to show.
|
|
Post new topic
Reply to topic
|
|
|
|