Last active
December 15, 2015 15:29
-
-
Save ricardosiri68/5282095 to your computer and use it in GitHub Desktop.
Hola! continuando con mi "trabajo" me topé con el siguiente problema: mostrar algún dato de una tabla que tengo en una base de datos dentro de un echo en php.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fecha = $_POST['fecha']; | |
$hora = $_POST['hora']; | |
$nombre = $_POST['nombre']; | |
$apellido = $_POST['apellido']; | |
$conexion = mysql_connect("localhost","user","pass"); | |
mysql_select_db("db",$conexion); | |
$sql= "INSERT INTO tabla (Fecha, Hora, Nombre, Apellido) VALUES ( '{$fecha}', '{$hora}','{$nombre}','{$apellido}')"; | |
$result = mysql_query($sql); | |
echo 'Datos cargados!'; | |
$res = mysql_query ("select max(Id) AS id from tabla", $conexion); | |
while ($row = mysql_fetch_object($res)) | |
{ | |
echo 'Id Número:'.$row->id.'</br>'; | |
} | |
echo '<a href="../index.html">Volver</a>'; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment