General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 18th, 2003, 04:33 AM
gpark gpark is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 1 gpark User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Compare values from CSV.....

Hi,

I have a CSV file which contains data from the search engines, which includes search engine, keyword, number of applicants and number of visits.

However in some cases there is repitition however I want to merge those figures together.

An example of what I mean....

AOL abc 64 361
Google widgets 56 1000
MSN xyz 48 1153
Google widgets 40 500

So this becomes:

AOL abc 64 361
Google widgets 96 1500
MSN xyz 48 1153

What I have done is upload a CSV file and insert the values into DB. However I need some assistance on how to compare each line of data so therefore compare the search engine and the keyword with another line of data and then merge the appropriate values together.

PHP Code:
 $allfiles file ($userfile); 
for (
$n=0;$n<sizeof($allfiles);$n++) 

$line explode(",",$allfiles[$n]); 

mysql_query("INSERT into tdata (searcheng,keyword,applicants,visits,tmid) VALUES ('$line[0]','$line[1]','$line[2]','$line[3]')"); 



Perhaps I need to place the name of the search engines into an array and keyword into another array as well, not quite sure. This may look a bit complex than first imagined.

Any assistance would be great.

Thanks.

W

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Compare values from CSV.....


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway