-1
I need to send what was entered in the input field and send by the POST method. My code is like this:
<?php
include_once("../controle/conexao.php");
//Recuperar o valor da palavra
$usuarios = $_POST['palavra'];
echo '$usuarios';
//Pesquisar no banco de dados o nome do usuario referente a palavra digitada
$result_usuarios = "SELECT * FROM cadastro_produtos WHERE descricao LIKE '%$usuarios%' OR id LIKE '%$usuarios%' LIMIT 1";
$resultado_usuarios = mysqli_query($conn, $result_usuarios);
if(mysqli_num_rows($resultado_usuarios) <= 0 ){
echo "Nenhum usuario encontrado";
}else{
while($rows_usuarios = mysqli_fetch_assoc($resultado_usuarios)){
echo "<tr>";
echo "<td class='text-center'>".$rows_usuarios['id']."</td>";
echo "<td class='text-center'>".$rows_usuarios['descricao']."</td>";
echo "<td class='text-center'><input name='qtd'></td>";
echo "<td class='text-center'>
<button type='submit' class='btn btn-xs btn-primary'>
Adicionar
</td>";
echo "</tr>";
}
}
?>
Does anyone have any suggestions?
You are speaking the input that is inside the while, to add the quantity?
– Willian
sorry, <input name='Qtd'>
– Junior