Advertisement

12.31.2007 at 04:53AM PST, ID: 23050603
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

Adding CSV data into a MySQL Database - arrays, implodes, explodes!

Asked by SamDavis in PHP and Databases, PHP Scripting Language, MySQL Server

Tags:

Hi, I have a CSV file that looks like the following...

TVWB09285~28 Dec 2007 13:57~DARRELL LITCHFIELD~THE JNP PARTNERSHIP~Address Line 1~-~HIGH WYCOMBE~Mainland UK~-~HP13 6LJ~DARRELL LITCHFIELD~01234567890~-~-~1~0~dl@xxx.co.uk~~UNI PLASMA TILT~phone order~~

TVWB09283~28 Dec 2007 13:16~Barbara Thomas~C P M~Address Line 1~Warrington~Mainland UK~-~WA4 6QS~Barbara Thomas~01234567890~C P M~-~3~0~barbara.thomas@xxx.com~~TV-FMEGA~~~

TVWB09282~28 Dec 2007 13:14~m gunn~~Address Line 1~-~Forres~Mainland UK~-~IV36 2US~m gunn~01234567890~-~-~1~0~billthebike@gmail.com~~TVW-33~~~

TVWB09281~28 Dec 2007 13:15~Mr B Andrews~~Address Line 1~-~Orpington~Mainland UK~-~BR6 8PD~Mr B Andrews~01234567890~-~-~1~0~barrysandya@googlemail.com~~TVW-32~~~

TVWB09280~28 Dec 2007 13:12~Mr Oliver~Cassis~Address Line 1~-~Broadstairs~Mainland UK~-~CT10 3QY~Mr Oliver~01234567890~Cassis~-~1~0~dave@xxx.com~~TVW-34~phone order~~

I need to enter this data into a MySQL database in a single fell swoop.  On the above data I have separated each separate "row" the a line space.  Obviously, in all realism, there won't be a line space within the CSV.  However, if required, I am able to add a special character before the order number (TWVB0XXXX) in order to make this clarification possible.

So I have created my database with the following fields, which the above data needs to be inserted into, in the order specified...

ref_id
order_number
date
name
company_name
address1
address2
towncity
county
na1
postcode
deliveryname
telephone
companybackup
na2
items
na3
email
na4
bagsize
weight
deliveryinstructions
na5

Can anyone help me do this.  I am good at basic level PHP, but when it gets to doing functions within functions, which this appears to be, this is where I get awful confused and mixed up.

I am assuming (maybe incorrectly) I have to explode the above data, into each row required to be added - and then I need to explode each row with the ~ charatcer in order to insert it into the DB.

I just dont know how to do it!  Any help appreciated :)Start Free Trial
[+][-]12.31.2007 at 04:55AM PST, ID: 20554394

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.31.2007 at 05:17AM PST, ID: 20554482

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.31.2007 at 05:20AM PST, ID: 20554500

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.31.2007 at 05:30AM PST, ID: 20554539

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.31.2007 at 05:35AM PST, ID: 20554560

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.31.2007 at 05:39AM PST, ID: 20554585

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.31.2007 at 05:40AM PST, ID: 20554590

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.31.2007 at 07:25AM PST, ID: 20555326

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.31.2007 at 08:00AM PST, ID: 20555644

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.31.2007 at 08:22AM PST, ID: 20555802

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.31.2007 at 09:01AM PST, ID: 20556112

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP and Databases, PHP Scripting Language, MySQL Server
Tags: PHP
Sign Up Now!
Solution Provided By: Roonaan
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628