Page 1 of 1

database

Posted: Thu Apr 22, 2021 3:13 pm
by Stevyn
create new database

Code: Select all

?php
$servername = "localhost";
$username = "username";
$password = "password";

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

// Create database
$sql = "CREATE DATABASE myDB";
if ($conn->query($sql) === TRUE) {
  echo "Database created successfully";
} else {
  echo "Error creating database: " . $conn->error;
}

$conn->close();
?>

Re: database

Posted: Thu Apr 22, 2021 3:14 pm
by Stevyn
table for books

id
isbn
title
author
description
price
shelf location
picture 1
picture 2
condition
paperback/hardcover
date aded