Skip to content

Commit

Permalink
sql and changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vinceerkadoo committed Apr 16, 2024
1 parent a0b5579 commit 3e72e98
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions components/connect.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

$db_name = 'mysql:host=localhost;dbname=shop_db';
$db_name = 'mysql:host=vincedarshini.webhop.me;dbname=shop_db';
$user_name = 'root';
$user_password = '';
$user_password = 'password';

$conn = new PDO($db_name, $user_name, $user_password);

Expand Down
23 changes: 12 additions & 11 deletions shop_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,21 @@ CREATE TABLE `messages` (
-- Table structure for table `orders`
--

CREATE TABLE `orders` (
`id` int(100) NOT NULL,
`user_id` int(100) NOT NULL,
`name` varchar(20) NOT NULL,
`number` varchar(10) NOT NULL,
`email` varchar(50) NOT NULL,
`method` varchar(50) NOT NULL,
`address` varchar(500) NOT NULL,
`total_products` varchar(1000) NOT NULL,
`total_price` int(100) NOT NULL,
`placed_on` date NOT NULL DEFAULT current_timestamp(),
CREATE TABLE `orders` (
`id` int(100) NOT NULL,
`user_id` int(100) NOT NULL,
`name` varchar(20) NOT NULL,
`number` varchar(10) NOT NULL,
`email` varchar(50) NOT NULL,
`method` varchar(50) NOT NULL,
`address` varchar(500) NOT NULL,
`total_products` varchar(1000) NOT NULL,
`total_price` int(100) NOT NULL,
`placed_on` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`payment_status` varchar(20) NOT NULL DEFAULT 'pending'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


-- --------------------------------------------------------

--
Expand Down

0 comments on commit 3e72e98

Please sign in to comment.