Perhas you want SELECT DISTINCT ?
http://www.mysql.com/doc/en/SELECT.html

Hope that helps,
Ken

----- Original Message ----- 
From: "Hunter, Jess" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 12, 2003 10:47 AM
Subject: How to keep multiple instances of the same information from
being displayed


> Using PHP as the front end I am creating a form with a dropdown box
that
> displays information from one table to be inserted into another
table.
> That's PHP and I have gotten that part down with no issue.
>
> However, in the table a person could be listed multiple times and I
only
> want a user to be listed a single time. for instance in the table I
may have
>
> Jones, Jim
> Jones, Mary
> Jones, Mary
> Jones, Mary
> Jones, Nancy
> Jones, Paul
>
> when I do my SELECT I only want Mary Jones to show up a single time.
>
> Here is the code I am currently using within the Dropdown box:
>
> <SNIPPET>
> $Link = mysql_connect($Host, $User, $Password);
> $Query="SELECT * from $TableName ORDER BY userlastname";
> $Result= mysql_db_query ($DBName, $Query, $Link);
>
> while ($Row = mysql_fetch_array ($Result)){
>
>
>
> print ("<option value='$Row[userlastname],
> $Row[userfirstname]'>$Row[userlastname],
$Row[userfirstname]</option>");
> }
> mysql_close ($Link);
> ?>
> </SNIPPET>
>
> As you can see I am pulling two fields from one table, then
combining them
> to make a single field in another table. I am doing this to provide
> continuity when I create queries in the future.
>
> Any help with this would be greatly appreciated
>
> Jess
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03
>
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]
>
>


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to