Hi, I have this problem with my php, which has not let me continue, in which I get the following error.
Fatal error: Uncaught Error: Call to undefined function mysql_fetch_assoc () in /storage/ssd1/730/8168730/public_html/Ingresar.php:144 Stack trace: # 0 {main} thrown in /storage/ssd1/730/8168730/public_html/Ingresar.php on line 144
I leave my code
<html>
<head>
<style>
th{
color:black;
background-color: white;
font-family: Arial,sans-serif;
font-size:24px;
}
td{
background-color: white;
color: black;
font-family: Arial,sans-serif;
font-weight: bold;
}
input[type=submit]{
font-family: arial,sans-serif;
font-weight: bold;
text-align: center;
color:black;
margin-top: 4px;
margin-bottom: 5px;
padding: 2px;
border: 2px solid black;
}
input[type=submit]:hover{
font-family: arial,sans-serif;
font-weight: bold;
text-align: center;
color:red;
margin-top: 4px;
margin-bottom: 5px;
padding: 2px;
border: 2px solid #FF0000;
}
</style>
</head>
<script>
function valida(e){
tecla = (document.all) ? e.keyCode : e.which;
if (tecla==8){
return true;
}
patron =/[0-9]/;
tecla_final = String.fromCharCode(tecla);
return patron.test(tecla_final);
}
</script>
<body>
<body background="Imagenes/Fondo6.jpg">
<center>
<table width="350" border="1">
<form action="Datos.php" method="post">
<tr >
<th colspan="3">INGRESO DE DATOS</th>
</tr>
<tr>
<td>Rut:</td>
<td colspan="2">
<input type="text" name="txtRut" placeholder="11.111.111-1" maxlength="12" align="right" size="30" tabindex="1" required>
</td>
</tr>
<tr>
<td>Ciudad:</td>
<td><input type="text" name="txtCiudad" size="30" maxlength="25" tabindex="2" required><br></td>
</tr>
<tr>
<td>Fecha:</td>
<td><input type="text" name="txtFecha" size="30" maxlength="20" tabindex="2" required><br></td>
</tr>
<tr>
<td>Producto:</td>
<td><input type="text" name="txtProducto" size="30" maxlength="25" tabindex="2" required><br></td>
</tr>
<tr>
<td>Valor Unitario:</td>
<td><input type="text" name="txtValor" size="30" id="utilidad" required><br></td>
</tr>
<tr>
<td>Cantidad:</td>
<td><input type="text" name="txtCantidad" size="30" id="utilidad" maxlength="4" required><br></td>
</tr>
<tr>
<td>Total:</td>
<td><input type="text" name="txtTotal" size="30" id="utilidad" disabled tabindex="3"><br></td>
</tr>
<tr>
<td>FormaPago:</td>
<td><input type="radio" name="FormaPago" value="Contado">Contado 20% dcto.<br>
<input type="radio" name="FormaPago" value="TarjetaBanco">Tarjeta Banco 10% dcto.<br>
<input type="radio" name="FormaPago" value="TarjetaTienda">Tarjeta Tienda 10% inte.</td>
</tr>
<tr>
<td>Paga Con?:</td>
<td><input type="text" name="txtMetodoPago" size="30" id="utilidad" maxlength="4" disabled tabindex="3"><br></td>
</tr>
<tr>
<tr>
<td>Descuento:</td>
<td><input type="text" name="txtDescuento" size="30" id="utilidad" maxlength="4" disabled tabindex="3"><br></td>
</tr>
<tr>
<td>Interes:</td>
<td><input type="text" name="txtInteres" size="30" id="utilidad" maxlength="4" disabled tabindex="3"><br></td>
</tr>
<tr>
<td>Total Pagar:</td>
<td><input type="text" name="txtTotalPagar" size="30" id="utilidad" maxlength="4" disabled tabindex="3"><br></td>
</tr>
<td colspan="3" align="center">
<input type="submit" name="BtnGrabar" value="Guardar">
</td>
</tr>
</form>
</table>
</center>
<br><br>
<center>
<table border="1" width="1000">
<tr>
<td colspan="20" align="center">LISTADO DE DATOS DE LA COMPRA</td>
</tr>
<tr align="center">
<td>N°</td>
<td>Rut</td>
<td>Ciudad</td>
<td>Fecha</td>
<td>Producto</td>
<td>Val.Unit.</td>
<td>Cantidad</td>
<td>Total</td>
<td>Forma Pago</td>
<td>Descuento</td>
<td>Interes</td>
<td>Total Pagar</td>
</tr>
<?php
include("ConexionPHP.php");
$TTablaP ="Select * From compra";
$Buscar = $ConexionBD->query($TTablaP);
$inc = 0;
while ($Registro = mysql_fetch_assoc($Buscar))
{
$inc++;
?>
<tr>
<td><?php echo $inc; ?></td>
<td><?php echo $Registro['Rut']; ?></td>
<td><?php echo $Registro['Ciudad']; ?></td>
<td><?php echo $Registro['Fecha']; ?></td>
<td><?php echo $Registro['Producto']; ?></td>
<td><?php echo $Registro['ValorUnitario']; ?></td>
<td><?php echo $Registro['Cantidad']; ?></td>
<td><?php echo $Registro['Total']; ?></td>
<td><?php echo $Registro['FormaPago']; ?></td>
<td><?php echo $Registro['Descuento']; ?></td>
<td><?php echo $Registro['Interes']; ?></td>
<td><?php echo $Registro['TotalPagar']; ?></td>
</tr>
<?php
}
?>
</table>
</center>
</body>
</html>