
Ayuda con codigo a decifrar en php y parece sqlite3
Publicado por MANUEL DE JESUS (1 intervención) el 19/09/2014 03:29:33
tengo un ejercicio el cual tenemos que realizar una modificacion a una tabla a travez de sqlite pero solo tengo el codigo que nos dieron de ejemplo donde hace la consulta y muestra los usuarios,
<?php include_once("db_conexion.php"); ?>
<?php
//$conn = conectar();
$db = new MyDB();
$sql = "SELECT * FROM TB_CLIENTE";
if ($res=$db->query($sql)) {
$encab_html = "<tr class='head'>";
$fila_html = "";
$encab = true;
while( $fila = $res->fetchArray()){
$columnas = $res->numColumns();
$fila_html .= "<tr>";
for($i = 0; $i < $columnas; $i++) {
if($encab) {
$encab_html .= "<td>". $res->columnName($i)."</td>";
}
$fila_html .="<td>".$fila[$i]."</td>";
}
$encab =false;
$fila_html .="</tr>";
}
$encab_html .= "</tr>";
$tabla = "<table width ='100%' >".$encab_html.$fila_html."</table>";
echo $tabla;
}
?>
<?php include_once("db_conexion.php"); ?>
<?php
//$conn = conectar();
$db = new MyDB();
$sql = "SELECT * FROM TB_CLIENTE";
if ($res=$db->query($sql)) {
$encab_html = "<tr class='head'>";
$fila_html = "";
$encab = true;
while( $fila = $res->fetchArray()){
$columnas = $res->numColumns();
$fila_html .= "<tr>";
for($i = 0; $i < $columnas; $i++) {
if($encab) {
$encab_html .= "<td>". $res->columnName($i)."</td>";
}
$fila_html .="<td>".$fila[$i]."</td>";
}
$encab =false;
$fila_html .="</tr>";
}
$encab_html .= "</tr>";
$tabla = "<table width ='100%' >".$encab_html.$fila_html."</table>";
echo $tabla;
}
?>
Valora esta pregunta


0