[PHP] I need unique max number
Hi all I have data in one field in a database, all is numbers that can be duplicated. 200, 200, 100, 50, 30. i need to get all data from this field, terminate the duplicates and get the max nuber that is not a duplicate, in the numbers above that would be 100. I had a look at array_unique, but i'm not sure if this is the right function for this. Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I need unique max number
Hi all I have data in one field in a database, all is numbers that can be duplicated. 200, 200, 100, 50, 30. i need to get all data from this field, terminate the duplicates and get the max nuber that is not a duplicate, in the numbers above that would be 100. I had a look at array_unique, but i'm not sure if this is the right function for this. Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php use array_unique will get 200, 100, 50, 30. you shoule write a custom function :) Ni Shurong [EMAIL PROTECTED] MAIL : [EMAIL PROTECTED] QQ : 412844 MSN : [EMAIL PROTECTED] BLOG : http://blog.njmars.com/myhan/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I need unique max number
Ni Shurong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all I have data in one field in a database, all is numbers that can be duplicated. 200, 200, 100, 50, 30. i need to get all data from this field, terminate the duplicates and get the max nuber that is not a duplicate, in the numbers above that would be 100. I had a look at array_unique, but i'm not sure if this is the right function for this. Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php use array_unique will get 200, 100, 50, 30. you shoule write a custom function :) Hi Ni, he needs to ignore duplicate values so array_unique() won't help. Regards, Torsten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I need unique max number
Ni Shurong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all I have data in one field in a database, all is numbers that can be duplicated. 200, 200, 100, 50, 30. i need to get all data from this field, terminate the duplicates and get the max nuber that is not a duplicate, in the numbers above that would be 100. I had a look at array_unique, but i'm not sure if this is the right function for this. Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php use array_unique will get 200, 100, 50, 30. you shoule write a custom function :) Hi Ni, he needs to ignore duplicate values so array_unique() won't help. Regards, Torsten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi Torsten, I got it :) But I didn't express clearly. your method is good ! :) Regards Ni Shurong [EMAIL PROTECTED] MAIL : [EMAIL PROTECTED] QQ : 412844 MSN : [EMAIL PROTECTED] BLOG : http://blog.njmars.com/myhan/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php