Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/wreyesus/Sencillo_Carrito_de_Compras_en_PHP/llms.txt

Use this file to discover all available pages before exploring further.

YUME|TEC stores its product catalogue, user accounts, categories, and purchase records in a MySQL database called tienda. The repository ships with a complete SQL dump at BD/bd.sql — generated by phpMyAdmin 2.11.4 against MySQL 5.1.57 — that creates all four tables and seeds them with sample data. This page walks through creating the database, importing the dump, and verifying that the data loaded correctly.

Schema overview

The BD/bd.sql file defines four tables:
TableDescription
categoriasStores the three product categories (procesadores, motherboards, rams). Each row tracks how many items the category contains.
productosHolds all 31 products. Each product belongs to a category via id_cat and carries a name, manufacturer, price, image filename, and description.
usuarioRegistered customer accounts. Stores nickname, first and last name, country, city, password, and registration date.
compraPurchase records linking a product (id_producto) to a user (idusuario) with an auto-updating timestamp.
The compra table is empty in the dump — it fills at runtime when customers complete an order.

Import steps

1

Create the database

Open phpMyAdmin or a MySQL CLI session and run:
CREATE DATABASE tienda CHARACTER SET latin1 COLLATE latin1_swedish_ci;
The latin1 character set matches the charset used throughout bd.sql, so product names and descriptions import without encoding errors.
2

Import the SQL dump

From the command line, run:
mysql -u root -p tienda < BD/bd.sql
Enter your MySQL root password when prompted. The command pipes the entire dump into the tienda database.Alternatively, use phpMyAdmin:
  1. Select the tienda database in the left-hand panel.
  2. Click the Import tab.
  3. Click Choose File and select BD/bd.sql from the project directory.
  4. Leave all other settings at their defaults and click Go.
3

Verify the import

Run these queries to confirm that the tables and sample data loaded correctly:
USE tienda;
SELECT COUNT(*) FROM productos;  -- should return 31
SELECT COUNT(*) FROM categorias; -- should return 3
Both counts should match the expected values before you proceed to configure the application.

Sample data

The dump inserts three category rows that drive the store’s navigation:
INSERT INTO categorias VALUES(1, 'procesadores', 10);
INSERT INTO categorias VALUES(2, 'motherboards', 10);
INSERT INTO categorias VALUES(3, 'rams', 10);
The contiene column (value 10 for each) is used by the application to control pagination — it represents the number of products displayed per category page. The dump then seeds 31 products spread across these three categories: 10 processors (category 1), 10 motherboards (category 2), and 10 RAM modules (category 3), plus one extra test product assigned to a non-existent category 4.
The database uses the latin1 character set with a Spanish collation (latin1_swedish_ci for most tables, utf8_spanish2_ci for the descripcion column of productos). If you connect with a client or application that assumes UTF-8, accented characters in product descriptions — such as é, ó, ñ — may appear as garbled sequences like cach? or n?cleos. Ensure your connection character set matches by running SET NAMES latin1 or by verifying the charset in Connections/tienda.php.

Sample users

The dump includes several test user accounts. The primary one is:
INSERT INTO usuario VALUES(1, 'ryuzaki', 'Saul', 'Guardado', 'El Salvador', 'Chalatenango', 'hola', '27 de Noviembre de 2011');
Log in with username ryuzaki and password hola to test the authenticated shopping flow without registering a new account.
Passwords are stored as plain text in the usuario table — there is no hashing or salting. This is acceptable for a local learning project, but it is not suitable for any shared, public, or production environment. Before deploying, replace the plain-text password field with a hashed value using password_hash() (requires a PHP 7+ migration) and update the login query accordingly.

Build docs developers (and LLMs) love