├── CSS
└── style.css
├── README.md
├── connection.php
├── delete_user.php
├── edit_user.php
├── index.php
├── insert_user.php
├── update.php
└── users.sql
/CSS/style.css:
--------------------------------------------------------------------------------
1 | * {
2 | box-sizing: border-box;
3 | margin: 0;
4 | padding: 0;
5 | }
6 |
7 | html {
8 | font-family: 'Segoe UI', sans-serif;
9 | text-align: center;
10 | }
11 |
12 | a{
13 | text-decoration: none;
14 | }
15 |
16 | .users-form form{
17 | display: flex;
18 | flex-direction: column;
19 | gap: 24px;
20 | width: 30%;
21 | margin: 20px auto;
22 | text-align: center;
23 | }
24 |
25 | .users-form form input{
26 | font-family: 'Segoe UI', sans-serif;
27 | }
28 |
29 | .users-form form input[type=text],
30 | .users-form form input[type=password],
31 | .users-form form input[type=email]{
32 | padding: 8px;
33 | border:2px solid #aaa;
34 | border-radius:4px;
35 | outline:none;
36 | transition:.3s;
37 | }
38 |
39 | .users-form form input[type=text]:focus,
40 | .users-form form input[type=password]:focus,
41 | .users-form form input[type=password]:focus{
42 | border-color:dodgerBlue;
43 | box-shadow:0 0 6px 0 dodgerBlue;
44 | }
45 |
46 | .users-form form input[type=submit]{
47 | border: none;
48 | padding: 12px 50px;
49 | text-decoration: none;
50 | transition-duration: 0.4s;
51 | cursor: pointer;
52 | border-radius: 5px;
53 | background-color: white;
54 | color: black;
55 | border: 2px solid #60a100;
56 | }
57 |
58 | .users-form form input[type=submit]:hover {
59 | background-color: #60a100;
60 | color: white;
61 | }
62 |
63 | .users-table table{
64 | border: 1px solid #ccc;
65 | border-collapse: collapse;
66 | margin: 0;
67 | padding: 0;
68 | width: 100%;
69 | table-layout: fixed;
70 | }
71 |
72 | table tr {
73 | background-color: #f8f8f8;
74 | border: 1px solid #ddd;
75 | padding: 4px;
76 | }
77 |
78 | table th{
79 | padding: 16px;
80 | text-align: center;
81 | font-size: .85em;
82 | }
83 |
84 | .users-table--edit{
85 | background: #009688;
86 | padding: 6px;
87 | color: #fff;
88 | text-align: center;
89 | font-weight: bold;
90 | }
91 | .users-table--delete{
92 | background: #b11e1e;
93 | padding: 6px;
94 | color: #fff;
95 | text-align: center;
96 | font-weight: bold;
97 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # CRUD con PHP y MySQL 🐘
2 |
3 | Este es un CRUD que creé con PHP y MySQL.
4 | Creada para el tutorial de CRUD con PHP y MySQL en mi canal de Youtube.
5 | **Mira el video haciendo click [aquí.](https://youtu.be/sYaEoNy5OGs)** 👈
6 |
7 | ## Uso
8 | Solo tienes que descargar el código, correr un server con XAMPP por ejemplo y crear la tabla usuarios con los campos (id, name, lastname, username, password, email).
9 |
10 | ## MySQL
11 | Dejaré el script de MySQL usado en el video.
12 |
13 | Sientete libre de descargar el código y modificarlo a tu antojo. Si tienes alguna duda o sugerencia, no dudes en dejar un comentario en el video. 😉
14 |
15 | ## Mis Redes Sociales
16 |
17 |
18 |
--------------------------------------------------------------------------------
/connection.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/delete_user.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/edit_user.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/index.php:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
ID | 40 |Nombre | 41 |Apellidos | 42 |Username | 43 |Password | 44 |46 | | 47 | | |
---|---|---|---|---|---|---|---|
= $row['id'] ?> | 53 |= $row['name'] ?> | 54 |= $row['lastname'] ?> | 55 |= $row['username'] ?> | 56 |= $row['password'] ?> | 57 |= $row['email'] ?> | 58 |Editar | 59 |Eliminar | 60 |