I'm looking at the order numbers table. After clicking on this select, I select the order number in the select and I want to load the order details on the same page, inside a table just below the select. Is it possible or do I have to send the data through $ _POST to another page and only then load the order details on the page where I have the select?
What I've done so far:
<body>
<form id="frm_dados_ljv" name="frm_dados_ljv" method="post" action="">
<p>Número do Pedido:
<select name="cbo_nps" size="1" id="cbo_nps">
<option value="0">Selecione...</option>
<?php
//Conecta o banco de dados e traz as informações dos produtos...
include("conexao.php");
$pdo=conectar();
try{
//Buscando dados...
$sql=$pdo->prepare("SELECT * FROM numped_loja WHERE status='A'");
$sql->bindParam(':idp', $_GET['idp'], PDO::PARAM_INT);
$sql->bindParam(':numped', $_GET['numped'], PDO::PARAM_STR);
$sql->execute();
//loop
while($linha=$sql->fetch(PDO::FETCH_ASSOC)){
//pegando o dado do campo
$numped = $linha["numped"];
//preenchendo a combo...
$np = "<option>".$numped."</option>";
echo $np;
};
//fechando a conexão
$pdo = null;
}
catch(PDOExcception $erro){
echo $erro->getmessage();
}
?>
</select>
</p>
</form>
<div id="tb1_loja"></div>
<div id="tb2_loja"></div>
</body>