1
Hello,
Guys, I want an action to be carried out over a certain amount of times defined by a form. For example:
The user chooses 5, then the code Isere 5 records in the database. Since each record should be incremental, for example, if you chose 5, then will record in the field in each of the records sequentially, 1,2,3,4,5.
I imagined starting like this:
$valor_escolhido = "5";
foreach($valor_escolhido as $vlr_esc){
$insert="INSERT INTO TABELA (campo1,campo2,campo3) VALUES ('$campo1','$campo2', '$valor_escolhido') ";
}
How would that look...?
So it is also gives Neo. The problem is that this way the server can generate an error
to many connections
. Because the server may get overloaded if there are more amounts of connection than the server is configured. Caution. =)– Andrei Coelho
That’s why I advise you to put the Insert string out of while and go concatenating.
– Andrei Coelho