Código PHP:
<?php
//Haciendo una conexion, y revisandola
mysql_connect('localhost','root','123456')or die ('Ha fallado la conexión: '.mysql_error());
mysql_select_db('sistemaweb')or die ('Error al seleccionar la Base de Datos: '.mysql_error());
$resultado =@mysql_query("SELECT u.usu_id, CONCAT (p.per_nombres, ' ', p.per_apellidos) as nombres ,Concat ( t.tie_cantidad, ' minutos') as tiempo , t.tie_fecha
FROM persona p
INNER JOIN usuario u USING (per_codigo)
INNER JOIN tiempo t USING (usu_codigo)")or die ('error en la query: '.mysql_error());
$registros=mysql_fetch_array($resultado);
$usu_id=$registros[usu_id];
$nombres=$registros[nombres];
$tiempo=$registros[tiempo];
$tie_fecha=$registros[tie_fecha];
echo(" tu id: ".$usu_id);
echo(" tus nombres: ".$nombres);
echo(" tu tiempo: ".$tiempo);
echo(" fecha: ".$tie_fecha);
?>
Código HTML:
<form action="procesos php/insertar_tiempo.php" method="post"> <table width="600" border="1" align="center"> <tr> <td width="102">ID</td> <td width="174">Nombres</td> <td width="62">Tiempo</td> <td width="92">Fecha</td> <td width="68"> </td> <td width="62"> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td><label> <input type="submit" name="button" id="button" value="Modificar" /> </label></td> <td><input type="submit" name="button2" id="button2" value="Eliminar" /></td> </tr> </table> </form>