Created
November 14, 2021 01:46
-
-
Save celestecastillo0/884c75103e37c3f6df2fa91bc3ffe771 to your computer and use it in GitHub Desktop.
DAWeb UIII act2
This file contains hidden or 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 | |
| $miservidor = "127.0.0.1"; | |
| $miusuario = "root"; | |
| $contra = ""; | |
| $mibasededatos = "banco"; | |
| //create connection | |
| $miconexion = new mysqli($miservidor, $miusuario, $contra, $mibasededatos); | |
| //check connection | |
| if ($miconexion->connect_error) { | |
| die("Fallo la conexion revisa tus datos de conexion !!!: " .$miconexion->connect_error); | |
| } | |
| echo "Bienvenido al servidor de base de datos"; | |
| //construir base de datos | |
| $laconsulta="SELECT * FROM empleado "; | |
| //mostrar resultados en tabla html | |
| print("<table>"); | |
| //Realizar la consulta | |
| $resultado = $miconexion->query($laconsulta); | |
| foreach ( $resultado as $rows) { | |
| print ("<tr>"); | |
| print ("<td>".$rows["NoEmp"]."</td>"); | |
| print ("<td>".$rows["NombreEmp"]."</td>"); | |
| print ("<td>".$rows["FechaIngEmp"]."</td>"); | |
| print ("<td>".$rows["PuestoEmp"]."</td>"); | |
| print ("<td>".$rows["TelefonoEmp"]."</td>"); | |
| print ("<td>".$rows["DomicilioEmp"]."</td>"); | |
| print ("<td>".$rows["CorreoEmp"]."</td>"); | |
| print ("</tr>"); | |
| } | |
| print("</table>"); | |
| ?> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
-- Servidor: 127.0.0.1
-- Tiempo de generación: 14-11-2021 a las 01:48:58
-- Versión del servidor: 10.4.21-MariaDB
-- Versión de PHP: 8.0.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT /;
/!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS /;
/!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION /;
/!40101 SET NAMES utf8mb4 */;
--
-- Base de datos:
banco--
-- Estructura de tabla para la tabla
clienteCREATE TABLE
cliente(NoClienteint(10) NOT NULL,NombreClientevarchar(150) NOT NULL,NoPrestamosClienteint(100) NOT NULL,SaldoClienteint(100) NOT NULL,TelefonoClientebigint(10) NOT NULL,DomicilioClientevarchar(150) NOT NULL,CorreoClientevarchar(100) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla
clienteINSERT INTO
cliente(NoCliente,NombreCliente,NoPrestamosCliente,SaldoCliente,TelefonoCliente,DomicilioCliente,CorreoCliente) VALUES(1, 'Celeste Castillo Flores', 5, 10000, 6561099703, 'AV TECNOLOGICO 2903 , MAGISTERIAL UNIVERSIDAD , CHIHUAHUA , CHIH , C.P. 31200', 'celestecastillo735@gmail.com'),
(2, 'Luis Eduardo Robles Ramos', 2, 200000, 6561098803, 'AV. JUAN ESCUTIA 1404 , LOMAS KARIKE , CHIHUAHUA , CHIH , C.P. 31120', 'Luisrobles08@gmail.com'),
(3, 'Brenda Flores Garcia', 1, 1000000, 6565513517, 'AVENIDA 5A PONIENTE 105 , CENTRO , DELICIAS , CHIH , C.P. 33000', 'Brenda566@gmail.com'),
(4, 'Jessica Fong Arredondo', 0, 50000, 6561099804, 'VENUSTIANO CARRANZA 803 , ROMA SUR , CHIHUAHUA , CHIH , C.P. 31350', '16jessica@gmail.com'),
(5, 'Selene Castillo Flores', 0, 300000000, 6562450909, 'ALDAMA Y V CARRANZA S/N , ZONA CENTRO , CHIHUAHUA , CHIH , C.P. 31000', 'Flornoire1409@gmail.com');
--
-- Estructura de tabla para la tabla
empleadoCREATE TABLE
empleado(NoEmpint(10) NOT NULL,NombreEmpvarchar(150) NOT NULL,FechaIngEmpdate NOT NULL,PuestoEmpvarchar(100) NOT NULL,TelefonoEmpbigint(10) NOT NULL,DomicilioEmpvarchar(150) NOT NULL,CorreoEmpvarchar(100) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla
empleadoINSERT INTO
empleado(NoEmp,NombreEmp,FechaIngEmp,PuestoEmp,TelefonoEmp,DomicilioEmp,CorreoEmp) VALUES(1, 'Jazmin Mendrano Mendoza', '2014-09-08', 'Subgerente', 6561099859, 'ALLENDE 1912 , ZONA CENTRO , CHIHUAHUA , CHIH , C.P. 31000', 'Jazminm0908@gmail.com'),
(2, 'Arturo Betancourt Cortez', '2011-10-03', 'Cajero', 6561985678, 'ALDAMA Y V CARRANZA S/N , ZONA CENTRO , CHIHUAHUA , CHIH , C.P. 31000', 'Arturob@gmail.com'),
(3, 'Yara Anchondo Blaz', '2020-11-10', 'Contador', 6561075692, 'CALLE 3 A NO. 604 , ZONA CENTRO , CHIHUAHUA , CHIH , C.P. 31000', 'Yanc123@gmail.com'),
(4, 'Mariana Acosta Rodriguez', '2017-12-09', 'Gerente', 6562098769, 'AVE TEOFILO BORUNDA 500 , ZONA CENTRO , CHIHUAHUA , CHIH , C.P. 31000', 'Mta2388@gmail.com'),
(5, 'Ramses Tovar Castillo', '2016-10-18', 'Contador', 6562099876, 'OJINAGA 309 , ZONA CENTRO , CHIHUAHUA , CHIH , C.P. 31000', 'Rams2@gmail.com');
--
-- Estructura de tabla para la tabla
transaccionesCREATE TABLE
transacciones(CuentaBancariaint(10) NOT NULL,TipoTransferenciavarchar(100) NOT NULL,MontoTransferenciabigint(100) NOT NULL,FechaTransferenciadate NOT NULL,NoTransaccionesint(100) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla
transaccionesINSERT INTO
transacciones(CuentaBancaria,TipoTransferencia,MontoTransferencia,FechaTransferencia,NoTransacciones) VALUES(1, 'Inmediata', 4000, '2021-11-09', 1),
(2, 'Urgente', 100, '2021-10-25', 1),
(3, 'Ordinaria', 10000, '2021-11-01', 7),
(4, 'Inmediata', 100, '2021-09-08', 1),
(5, 'Ordinaria', 200000, '2021-11-10', 3);
--
-- Índices para tablas volcadas
--
-- Indices de la tabla
clienteALTER TABLE
clienteADD PRIMARY KEY (
NoCliente);--
-- Indices de la tabla
empleadoALTER TABLE
empleadoADD PRIMARY KEY (
NoEmp);--
-- Indices de la tabla
transaccionesALTER TABLE
transaccionesADD PRIMARY KEY (
CuentaBancaria);--
-- AUTO_INCREMENT de las tablas volcadas
--
-- AUTO_INCREMENT de la tabla
clienteALTER TABLE
clienteMODIFY
NoClienteint(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;--
-- AUTO_INCREMENT de la tabla
empleadoALTER TABLE
empleadoMODIFY
NoEmpint(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;--
-- AUTO_INCREMENT de la tabla
transaccionesALTER TABLE
transaccionesMODIFY
CuentaBancariaint(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT /;
/!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS /;
/!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;