Contribua

Doação

terça-feira, 16 de maio de 2017

Acessar valorres de uma tabela mysql com  bindColunn, e popular uma tablela  html.

<?php
include "pluga.php";

 $ida = $_POST["id"];

// bind column to variable

$sql = "SELECT *  from  pecas where id = $ida";

$sq_stat = $conn->prepare($sql);
$sq_stat->execute();

// bind column to variable for display
$sq_stat->bindColumn(1, $id);
$sq_stat->bindColumn(2, $descr);
$sq_stat->bindColumn(3, $valor);
$sq_stat->bindColumn(4, $quant);
$sq_stat->bindColumn(5, $total);
$sq_stat->bindColumn(6, $ids);


while ($sq_stat->fetch()) {
". $id .  . $descr . . $valor .  . $quant .  . $total . . $ids .  " ;
}

?>
<html>
<head><link rel="stylesheet" type="text/css" href="juve.css"></head><body>
<center><form name="formulario" action="altera3.php" onsubmit="return validate()" method="post">

<center><table >

<tr><td><center> <label >Pecas de Servico </label></center></td></tr>                                
<tr><td><label class="style1">id:                </label><input name="id"       type="text" id="id"       size="100"  maxlength="50"   value=<?php echo "'$id'";?>    /></td></tr>
<tr><td><label class="style1">Descricao:              </label><input name="nome"     type="text" id="nome"     size="100"  maxlength="50"   value=<?php echo "'$descr'";?>  /></td></tr>
<tr><td><label class="style1">Quantia:             </label><input name="email"    type="text" id="email"    size="100"  maxlength="50"   value=<?php echo "'$valor'";?> /></td></tr>
<tr><td><label class="style1">Valor:</label><input name="ramo"     type="text" id="ramo"     size="100"  maxlength="50"   value=<?php echo "'$quant'";?>  /></td></tr>
<tr><td><label class="style1">Total:          </label><input name="fone"     type="text" id="fone"     size="100"  maxlength="50"   value=<?php echo "'$total'";?>  /></td></tr>
<tr><td><label class="style1">Ids:    </label><input name="insc"     type="text" id="insc"     size="100"  maxlength="50"   value=<?php echo "'$ids'";?>  /></td></tr>
<tr><td colspan="2">
<tr><td>
<ul id="menubv2">
<li><a><input id="CADASTRA"  name="CADASTRAr" type="submit" value="ALTERA" ></a></li>
<li><a href="index.html"><input type="button" value="PAGINA INICIAL" /></a></li>
    </ul>
<center><span class="style1">* Campos com * s&atilde;o obrigat&oacute;rios! *</span></p>
<p>&nbsp; </p></td></tr>
 </table>
</form></center>


</body>
</html>

Mais exemplos em  :


Inte:

Nenhum comentário:

Postar um comentário

Programa exempo para consulta em bd Mysql com programa C

#include<stdio.h> #include<mysql/mysql.h> # ...