Jump to content

cannot get all POST values


amalafrida

Recommended Posts

Trying to POST values from a table ... each table cell represents 1 hour of each day for 6 months ... total approx. 4000

 

the cells are named datacell[0] ... datacell[4000]

 

however, when i

            foreach($_POST['datacell'] as $key=>$val)
            {
                $codes.=$val;
            }
echo strlen($codes);

 

strlen is only 1001 ... same if I push them into an array

 

any suggestions?

 

beginning to think I have reached an unwieldy limit here ...

 

break the calendar up ... present only one month at a time?

Link to comment
https://forums.phpfreaks.com/topic/267439-cannot-get-all-post-values/
Share on other sites

each table cell represents 1 hour of each day for 6 months.

Why have you done it like this, instead of just saving a timestamp in a single column? By the looks of things, you've made things a lot more complicated for yourself than necessary.

I don't understand your "timestamp/column" comment.

 

The first cell of each row carries a timestamp.

 

a typical row resembles the following:

 

<td> <input type='text' name='date[1345438800]' value='Mon-20-Aug' /></td>

<td> <input type='text' name='datacell[0]' value='Z' /> </td>
....
<td> <input type='text' name='datacell[23]' value='A' /> </td>

 

I'm looping through and picking up each day's sequence of 24 values and placing them into an array ...

key=timestamp

value=24 letter codes ...

then to the database with it ...

 

user is free to modify any of the available text boxes.

According to your post, you have a series of cells representing a series of points in time. This is not an optimal way to solve a problem. Time isn't a description of the data, it is the data itself. Not to mention how much more difficult it becomes to actually retrieve the data associated with those points in time, as you now have to loop through tens of thousands of fields, instead of just one row per data point with some actual data.

 

To show what I mean in code, instead of using something like this:

day, user, time_1, time_2, time_3, time_4, time_6.... (And so forth)

You should be using something like this:

user, time, event

 

As you see, not only does this describe the data a lot better, but you only have three fields to work with. In addition to that, they all three contain data all of the time, unlike the first example.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.