Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning: a form on this page has more than 1000 fields PHP MySql [closed]

Tags:

php

mysql

I've got a questionnaire that went live over the weekend. After reaching so many entries PhpMyAdmin started showing this warning:

Warning: a form on this page has more than 1000 fields. On submission, some of the fields might be ignored, due to PHP's max_input_vars configuration.

The table is called survey and it has 10 columns and 300 rows of data - mostly strings. I don't get where its getting the number 1000 fields from? Everything was fine until the survey table got to about 150 entries. I'm worried I will lose my data.

My questionnaire comprises of 20 pages all with multiple choice questions. All values are stored in the $_SESSION array then sent to the DB on the 21st page.

PhpMyAdmin

like image 239
user1574598 Avatar asked Dec 08 '14 19:12

user1574598


People also ask

How do I change the maximum number of input variables in a PHP script?

By default, the maximum number of input variables allowed for PHP scripts is set to 1000. You can change this amount by setting the max_input_vars directive in a php. ini file. To verify the current value of the max_input_vars directive and other directives, you can use the phpinfo() function.

What is max_input_vars?

max_input_vars is a setting managed through the PHP setting file (php. ini) which limits the number of inputs you can set when posting forms. The Jomres Micromanage and Standard tariff editing modes allow you to have precise control over the price of each and every day in your property, for each room type.


1 Answers

You aren't going to lose data. This error message is specific to you trying to see the contents of the table and selecting too many rows at once. The number of columns in the table multiplied by the number of rows displayed should be below the value set for max_input_vars in your php.ini. By default this is set to 1000.

When you are working with your specific code, you shouldn't encounter this error UNLESS you try to do the same thing--display more than 1,000 "elements" from a returned query at one point in time. Do you really expect to do that? If so, then be smart about paginating your data and using LIMIT in your SQL query.

The data itself is safe. The only thing affected is PHP's ability to retrieve and output.

like image 114
jcanker Avatar answered Sep 25 '22 05:09

jcanker