Register on the forum now to remove ALL ads + popups + get access to tons of hidden content for members only!

Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > Javascript

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 09-21-2011, 08:44 PM   #1
mjvndhsb
Registered User
 
Join Date: Jul 2011
Posts: 177
Not allowing duplicate values to an array

Hi,
How can I prevent duplicate values from getting stored into an array? I am trying to dynamically populate an array with data using the concat() function, but I do not want to allow duplicate selection to be stored in the array. Total noob here. Pls help! Thanks.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
mjvndhsb is offline   Reply With Quote

Old 02-29-2012, 01:56 AM   #2
Spoint_Vinil
Moderator
 
Join Date: Sep 2011
Location: INDIA
Posts: 234
Send a message via Skype™ to Spoint_Vinil
you need to sort the array and then check for duplicates.hope this would work or let me know if not working still
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Spoint_Vinil is offline   Reply With Quote
Old 11-10-2012, 11:13 PM   #3
jaydeee
Registered User
 
Join Date: Mar 2010
Posts: 40
that would be easy if you have ID on every record. So load this on your array:
select distinct(id) from table1
hope that helps.
__________________
Get your
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jaydeee is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:26 PM.


Powered by vBulletin Copyright © 2013 vBulletin Solutions, Inc.