Jump to content


Photo

Complicated script needing complex help.


  • Please log in to reply
3 replies to this topic

#1 ksumner

ksumner
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 14 May 2006 - 03:34 AM

Hi guys I am trying to make a php v4 script that takes the following:

ksumner,JohnQ@public.com,John,Public,154 PUBLIC LN FAKE,Kelso,WA,98626,US,F,1981-04-09

salesagent,email,fname,lname,street,city,state,zip,country,gender,birthdate

I have been collecting mailing information on my website for some time now and I have over 3 million contacts in a flat textfile this is very slow to load on my computer and I fear that one day it might not open!

So I have been trying to develop a script to read this TXT file and import all the information into a MySQL database then have some basic search function to pull up contacts by city/state or gender.

Is this possible?

Thanks!

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 14 May 2006 - 03:44 AM

Why am I suspicious about a contact list with 3,000,000+ contacts in it? Sure sounds like something a spammer would love to have.

Just to prove your request is legit, would you mind telling us which website you operate that can get 3 million people to sign up for something.
Legend has it that reading the manual never killed anyone.
My site

#3 ksumner

ksumner
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 14 May 2006 - 03:47 AM

[!--quoteo(post=373645:date=May 13 2006, 11:44 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 13 2006, 11:44 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Why am I suspicious about a contact list with 3,000,000+ contacts in it? Sure sounds like something a spammer would love to have.

Just to prove your request is legit, would you mind telling us which website you operate that can get 3 million people to sign up for something.
[/quote]

I operate a goverment funded site called [a href=\"http://www.freecondoms.com/\" target=\"_blank\"]http://www.freecondoms.com/[/a]

We ship condoms to people who need them but are to shy or poor to buy them.


#4 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 14 May 2006 - 05:34 AM

free condoms? woot! j/k

setup your table with the various columns you need, then look into the file function [a href=\"http://www.php.net/file\" target=\"_blank\"]http://www.php.net/file[/a] for opening and reading the file, and the preg_match function for pulling out each line of info [a href=\"http://www.php.net/preg_match\" target=\"_blank\"]http://www.php.net/preg_match[/a]

I assume that you probably have a lot of that code already in existence, seeing as how that file had to be made somehow, so most of the hard work is probably already done.

so then, all you have to do is run a while loop (while there are lines to be read from the file, that is) and insert a new row into the table. other than the sheer volume of this file, it seems like a pretty straightforward task.

or, you could do it another way:

write a script to reformat your file in such a way to make it sql data friendly (kinda like how you would export your data from phpmyadmin or something) and then just import it directly into the database.

Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users