Ticapril / products

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Object Oriented PHP, PDO and MySQL - Scandiweb Code for implementing a CRUD with object-oriented PHP and MySQL.

Database

Create a database and execute the SQL instructions above to create the table products:

  CREATE TABLE `products`(
  	`id` int(30) NOT NULL,
  	`sku` varchar(255) NOT NULL,
  	`name` varchar(255) NOT NULL,
  	`price` float NOT NULL,
  	`measure` varchar(255) NOT NULL,
  	PRIMARY KEY (`id`) USING BTREE
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

table struct product_specific

CREATE TABLE `product_specific` (
  `id` int(11) NOT NULL,
  `name` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Extracting data from the table product_specific

INSERT INTO `product_specific` (`id`, `name`) VALUES
(1, 'DVD'),
(2, 'Book'),
(3, 'Furniture');

Settings

The database credentials are in the ./app/Db/Database.php file and you must change it to your environment settings (HOST, NAME, USER and PASS).

Composer

For the application to work, it is necessary to run Composer so that the files responsible for autoloading the classes are created.

To run composer, just access the project folder and run the command below in your terminal:

 composer install

After this execution, a folder with the name vendor will be created in the root of the project and you will be able to access it through your browser.

About


Languages

Language:PHP 53.3%Language:HTML 37.1%Language:JavaScript 7.4%Language:CSS 2.2%