I guess when you say "amount of data," you mean amount of columns coming from the bank, right? If so, maybe it works:
Connecting in the bank:
<?php
define('DB_NAME', 'insira_aqui_o_nome_do_banco');
//as informações abaixo são padrão, mas podem variar conforme você configurar seu banco
define('DB_USER', 'root');
define('DB_HOST', 'localhost');
define('DB_PASS', 'root');
define('DB_PORT', '3306');
$conexao = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
if (!$conexao) {
dir('Erro ao conectar no banco: ' . mysql_error());
}
?>
After that, you count how many columns the bank (in case, any table you choose) is bringing:
<?php
INCLUDE "conexao.php";
$sql = "DESCRIBE [nome_da_tabela]"; //usando DESCRIBE, o banco vai trazer uma linha para cada coluna da tabela, assim você pode contá-las com mysqli_num_row
$result = mysqli_query($conexao, $sql);
$numColunas = mysqli_num_rows($result);
?>
Now going to the form:
<?php
for ($i = 1; $i <=$numColunas; $i++) {
?>
<form class="form-group" method="POST" action="cadastro.php">
<label> nomePopular<? echo $i ?></label> /aconselho usar bootstrap para melhorar a aparência
<input name="nomePopular<? echo $i ?>" type="text">
<?php
}
?>
<button name="submit" id="submit">Submit</button>
</form>
Receiving inputs on the.php sign-up page:
<?php
if (isset($_POST["submit"])) {
for ($i = 1; $i <=$numColunas; $i++) {
?>
$nomePopular . $i = $_POST['nomePopular . $i'];
}
I’m just not sure if this last code to get the values of the POST are correct because I didn’t test it, maybe I have syntax error, but I could give an idea. I hope it helped.
Note that it is possible to omit
id
without any loss of functionality:<input name="nomePopular[]" type="text">
. PHP will populate the index incrementally, provided from 0.– gmsantos