<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>
	
	
	
	<?php
$servername = "localhost";
$username = "root";
$password = "";
	$dbname = "lbs";

// Create connection
$con = mysqli_connect($servername, $username, $password);
// Check connection
if (!$con) {
  die("Connection failed: " . mysqli_connect_error());
}

// Create database
$sql = "CREATE DATABASE $dbname";
if (mysqli_query($con, $sql)) {
	
	$conn = new mysqli($servername, $username, $password, $dbname);
	$connn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}

// sql to create table
$sql = "CREATE TABLE txn_table (
`product_id` int(20) NOT NULL,
  `product_name` varchar(20) NOT NULL,
  `customers_name` varchar(225) NOT NULL,
  `amount` int(20) NOT NULL,
  `unit_c` int(225) NOT NULL,
  `s_qty` int(225) NOT NULL,
  `user_id` int(11) NOT NULL,
  `time` varchar(225) NOT NULL,
  `date` varchar(40) NOT NULL,
  `month` varchar(225) NOT NULL,
  `year` varchar(255) NOT NULL
)";

	$conn->query($sql);
	
	$sq = "CREATE TABLE product_table (
`product_id` int(20) NOT NULL,
  `product_name` varchar(20) NOT NULL,
  `customers_name` varchar(225) NOT NULL,
  `amount` int(20) NOT NULL,
  `unit_c` int(225) NOT NULL,
  `s_qty` int(225) NOT NULL,
  `user_id` int(11) NOT NULL,
  `time` varchar(225) NOT NULL,
  `date` varchar(40) NOT NULL,
  `month` varchar(225) NOT NULL,
  `year` varchar(255) NOT NULL
)";
	$connn->query($sq);

if ($conn->query($sql) === TRUE) {
  echo "Table MyGuests created successfully";
} 
	
	
	else {
  echo "Error creating table: " . $conn->error;
}


	
	
  echo "Database created successfully";
} else {
  echo "Error creating database: " . mysqli_error($con);
}

	

	$con->close();

	

?>
	
	
	<?php
/*$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";*/

// Create connection
/*$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}

// sql to create table
$sql = "CREATE TABLE MyGuests (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
firstname VARCHAR(30) NOT NULL,
lastname VARCHAR(30) NOT NULL,
email VARCHAR(50),
reg_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)";

if ($conn->query($sql) === TRUE) {
  echo "Table MyGuests created successfully";
} else {
  echo "Error creating table: " . $conn->error;
}

$conn->close();*/
?>
	
	
	
	
	
	
</body>
</html>