Question 1: How many characters MAXIMUM can be stored in a regular php variable?
example: $x=”blablablablabla….”;
Question 2: The reason why I am asking #1 is that I was wondering if it was better for performance to perform a single SQL INSERT of 10 000 lines at the end of my loop or to perform 10 000 INSERTS of 1 line on each loop? Does it make any difference or it’s the same?
Question 1 is irrelevant, because there is going to be a performance issue long before you reach the maximum string allocation.
Ultimately, the answer to question 2 will probably lie between a one-row insert and a 10,000-row insert. For example, perhaps doing 100 inserts of 100 rows will be faster. Benchmark and test to determine the optimal number of rows per query.