Welcome Guest, Not a member yet? Register   Sign In
Noob Question
#2

[eluser]RobertSF[/eluser]
If I'm understanding correctly, the database could look like this?

Code:
Field Name, Field Value, Timestamp
your_name, Joe Blow, Oct 02, 2014 10:00
your_email, [email protected], Oct 02, 2014 10:00
your_name, John Smith, Oct 02, 2014 12:00
your_email, [email protected], Oct 02, 2014 13:15
your_name, Lisa Simpson, Oct 02, 2014 14:00
your_email, [email protected], Oct 02, 2014 14:00

If yes, I don't think this is specifically a Codeigniter thing. No matter what you used, you would have to untangle that and convert it to something like this:

Code:
Your Name, Your Email, Timestamp
Joe Blow, [email protected], Oct 02, 2014 10:00
John Smith, no email entered, Oct 02, 2014 12:00
no name entered, [email protected], Oct 02, 2014 13:15
Lisa Simpson, [email protected], Oct 02, 2014 14:00

It's pretty much a coding exercise that requires you to loop through the input file, assemble the record, and write it to the output file. If all records consist of the same number of lines in the input file -- that is, if everyone leaves both their names and emails and not just one or the other -- the task is much simplified. If some records consist of one lines and others of two lines in the input file, you'll have to match by the timestamp, which I would hope is the same when there are two lines per record.

There are three basic tasks here.
1.- Convert the irregular input file (the form submissions) to a regular CSV output file.
2.- Take the output file and write the records to a real database (MySQL or other).
3.- Have a view to display those records, with or without a search facility.

You could have controllers for the first two. The first wouldn't even need a model, and both would have a simple view that simply said, "Hi, operation completed successfully," or something like that.

For the third task, you'd have a full MVC, but by then, you'd have a normalized database.

I hope that helps.


Messages In This Thread
Noob Question - by El Forum - 09-29-2014, 07:48 PM
Noob Question - by El Forum - 10-02-2014, 10:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB