Array sorting question...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



	I am trying to populate an array from a MySQL database.  I think I
have the code correct to populate the array, but I need to somehow sort the
array eliminating duplicate values.  I think I can loop through the array
doing a comparison and building a new array by discarding the value if it is
a duplicate, but I was not sure if there was a more efficient way of doing
this.  I am already looping through the database query results, and I am
just thinking about efficiency here.
	Here is a code sample with a little more description of what I am
attempting...

<?php
  do {
  	$entry = $list['id_sys'];
            $id = split('-', $list['id_sys'], 1);
	$sbcuid = $id[0];
	$users[] = '$sbcuid';  
  } while ($list = mysql_fetch_assoc($result));
?>

	This query pulls a value from the database that is a
username-hostname value.  What I am working on is building a page that has a
unique list of usernames that link to a second page of user account
information.  There may be twenty user account on different hosts for the
same username.  I only want to have the username link created once on this
page.  I hope that makes since to everyone.  Thanks in advance for any help.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  sn4265@xxxxxxx
Web:  http:\\ldsa.sbcld.sbc.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux