Database Project My SQL PHP HTML Css Java Script
Database Project My SQL PHP HTML Css Java Script
con.connect(function(err) {
if (err) throw err;
console.log("Connected!");
con.query("CREATE DATABASE students", function (err, result) {
if (err) throw err;
console.log("Database created");
});
});
The database development life cycle includes eight steps that help guide us through the creation
of a new database. The steps are planning, requirement gathering, conceptual design,
logical design, physical design, construction, implementation and rollout, and finally
ongoing support.
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
Run the Command Line Interface(CLI) as an Administrator
C:\windows\system32>cd\
C:\>cd xampp
C:\xampp>cd mysql
C:\xampp\mysql>cd bin
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
MariaDB [(none)]> use students;
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
MariaDB [students]> select * from information;
MariaDB [students]> insert into persons(person_id, name, age, city) values(01, 'Peter
Williams', 26, 'Braga');
Query OK, 1 row affected (0.016 sec)
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
MariaDB [students]> show tables;
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
MariaDB [students]> CREATE TABLE Subject(Subject_ID INT(10), Subject_Name
VARCHAR(100), Teacher VARCHAR(100));
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
INSERT AND DELETE DATA IN A ROW FROM TABLE
MariaDB [students]> INSERT INTO grade_maths(grade_id, person, grade, observation)
VALUES(1, 'Peter Williams', 8, 'pass');
MariaDB [students]> DELETE FROM grade_maths WHERE grade_id=2;
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
MariaDB [students]> SELECT * FROM persons INNER JOIN grade_maths ON
person_id=grade_id;
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
MariaDB [students]> UPDATE grade_it SET observation = 'pass' WHERE grade_id=1;
We also can Confirm if the Primary Key already set in Localhost MySQL Server 127.0.0.1
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
Inserting values into the table, without declaring the attribute or variable.
MariaDB [students]> select person, observation from grade_it where observation = 'fail';
MariaDB [students]> select person, grade, observation from grade_it where observation =
'fail';
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
MariaDB [students]> ALTER TABLE grade_it ADD PRIMARY KEY(grade_id);
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
Data or Information in Table – Grade_IT
Showing Data that has successfully INSERTED INTO the table grade_it in MySQL
Showing Data that has successfully INSERTED INTO the table grade_it from MySQL in
HTML
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
Showing all the Data or Information From table grade_maths in HTML/PHP browser
SHOW ALL THE PERSON IN TABLE PERSONS – Using MySQL in CLI from Localhost;
MariaDB [students]> SELECT* FROM persons;
SHOW ALL THE PERSON IN TABLE PERSONS – Using HTML, PHP and CSS in Browser from Localhost;
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
CRUD – Create, Read, Update and Delete
Manipulating and Analyzing Data using CRUD Database Management System
Data Updated or Inserted in Database using CRUD in PHP and HTML also can be seen in
MySQL, so then this two(2) application is interacted very well.
MariaDB [students]> SELECT * FROM grade_it;
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
As the Result in the Table Grade IT shows in HTTP browser
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
As we see our Data in the Table it has been DELETED.
This project is still ongoing, while I was developing function to edit and deleting the data from the
Table using PHP programming language, because until now it is not functioned yet.
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
We need to call the database from Localhost in PHP to import in the table;
<?php
$mysqli = new mysqli('localhost', 'root', '', 'students') or die(mysqli_error($mysqli));
$result = $mysqli->query("SELECT * FROM grade_it") or die($mysqli->error);
?>
We also need to edit the Connector PHP in Database for it can edit, update and delete the
as we set the button so it will be function as we want it.
The error before is at;
$result = $mysqli->query("SELECT * FROM grade_it WHERE grade_id = '$grade_id'") or
die($mysqli->error());
//ERROR STARTING HERE BEFORE - for Edit Button
if (isset($result)==1){ //if (isset($result)==1)->set to if (isset($result)==1)
$row = $result->fetch_array();
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
As now it can be shown in the web http web browser;
Data or information is editable or update and able to delete over the web browser using
button that has defined not only by using commands in MySQL.
After data can be managed over the HTML, PHP, CSS and Bootstrap; all the information can
be editable, updateable and insertable or able to delete in browser application system we
continuously manage information that has been set in the localhost with MySQL in order to
know more in advance of Relational Database Management System(RDBMS).
There are four(5) JOINs in RDBMS such as; INNER JOIN, LEFT JOIN, RIGHT JOIN, CROSS
JOIN and FULL JOIN
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
PHP Commands for CRUD – Create, Read, Update and Delete
if ($con){
echo "Your Connection is Successfull";
}else{
die (mysqli_error($con));
}
?>
if(isset($_POST['save'])){
$id = $_POST['id'];
$name = $_POST['name'];
$mobile = $_POST['mobile'];
$email = $_POST['email'];
$password = $_POST['password'];
if($result){
echo "Data Inserted Successfully";
//header('location:info.php');
}else{
(mysqli_error($con));
}
}
?>
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
PLUS(+) with HTML, CSS and Bootstrap coding for FORM
<html>
<head>
<meta charset="utf-8">
<!--Bootstrap Style-->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<title>Form Insert Data</title>
</head>
<body>
<h1 align ="center" my-5>Entry Data Information Form</h1>
<div class="container my-5">
<form method="post">
<div class="form-group">
<label>Form_ID</label>
<input type="text" class ="form-control" placeholder="Enter Form ID" name="id">
</div>
<div class="form-group">
<label>Name</label>
<input type="text" class ="form-control" placeholder="Enter Person's Name"
name="name">
</div>
<div class="form-group">
<label>Mobile</label>
<input type="text" class ="form-control" placeholder="Enter Mobile Number"
name="mobile">
</div>
<div class="form-group">
<label>E-mail</label>
<input type="text" class ="form-control" placeholder="Enter E-mail" name="email">
</div>
<div class="form-group">
<label>Password</label>
<input type="text" class ="form-control" placeholder="Enter Passsword"
name="password">
</div class="container my-5">
<button type="save" class="btn btn-primary" name="save">Save</button>
</form>
</div>
</body>
</html>
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
Create information/display table in PHP to PRINT Data into the Browser [INFO.PHP]
<?php
include 'connect.php';
?>
<html>
<head>
<meta charset="utf-8">
<!--Bootstrap Style-->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<title>Information Display DB</title>
</head>
<body>
<h1 align ="center" class = "my-4">Information Inserted Form </h1>
<div class="container">
<button class="btn btn-primary my-3"><a href="form.php" class="text-
light">Add Form</a></button>
</div>
<!--COPIED FROM BOOTSTRAP-->
<div class="container my-5">
<table class = "table">
<th scope="col">Form ID</th>
<th scope="col">Name</th>
<th scope="col">Mobile Number</th>
<th scope="col">E-mail</th>
<th scope="col">Password</th>
<th scope="col">Action$&Operation$</th>
<tbody>
<tr>
<?php
$sql="SELECT * FROM crud";
$result=mysqli_query($con,$sql);
if($result){
while
($row=mysqli_fetch_assoc($result)){
$id = $row['id'];
$name = $row['name'];
$mobile = $row['mobile'];
$email = $row['email'];
$password = $row['password'];
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
echo
'<tr>
<td>'.$id.'</td>
<td>'.$name.'</td>
<td>'.$mobile.'</td>
<td>'.$email.'</td>
<td>'.$password.'</td>
<td>
</td>
</tr>';
}
}
?>
</table>
</div>
</body>
</html>
include 'connect.php';
if(isset($_GET['deleteid'])){
$id=$_GET['deleteid'];
}
$sql="DELETE FROM crud WHERE id=$id";
$result=mysqli_query($con,$sql);
if($result){
//echo "Data Successfully Deleted";
header('location:info.php');
}else{
die (mysqli_error($con));
}
?>
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
Commands for UPDATE Button [UPDATE.PHP]
<?php
include 'connect.php';
//COPIED FROM FORM PHP AS WE WANT TO PRINT DATA AS IT IS PRINTED IN FORM PHP
if(isset($_POST['save'])){
$id = $_POST['id'];
$name = $_POST['name'];
$mobile = $_POST['mobile'];
$email = $_POST['email'];
$password = $_POST['password'];
if($result){
// echo "Data Inserted Successfully";
header('location:info.php');
}else{
(mysqli_error($con));
}
}
?>
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
<html>
<head>
<meta charset="utf-8">
<!--Bootstrap Style-->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<title>Update Information</title>
</head>
<body>
<h1 align ="center" my-5>Update Entry Data Information Form</h1>
<div class="container my-5">
<form method="post">
<div class="form-group">
<label>Form_ID</label>
<input type="text" class ="form-control" placeholder="Enter Form ID"
name="id" VALUE=<?php echo $id; ?>>
</div>
<div class="form-group">
<label>Name</label>
<input type="text" class ="form-control" placeholder="Enter Person's
Name" name="name" VALUE=<?php echo $name; ?>>
</div>
<div class="form-group">
<label>Mobile</label>
<input type="text" class ="form-control" placeholder="Enter Mobile
Number" name="mobile" VALUE=<?php echo $mobile; ?>>
</div>
<div class="form-group">
<label>E-mail</label>
<input type="text" class ="form-control" placeholder="Enter E-mail
Address" name="email" VALUE=<?php echo $email; ?>>
</div>
<div class="form-group">
<label>Password</label>
<input type="text" class ="form-control" placeholder="Enter Passsword"
name="password" VALUE=<?php echo $password; ?>>
</div class="container my-5">
<button type="save" class="btn btn-primary" name="save">Update</button>
</form>
</div>
</body>
</html>
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
Here are the result of the PHP, MySQL, Bootstrap and CSS :
Data inserted to PRINT in the DISPLAY Information
When Clicked on the UPDATE Button the page will Show in Browser as;
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
JOINS
When we talk about JOINS means combine two or more tables according to the related
column. As we se in our MySQL Database Management System, we want our STUDENTS
Database to show us Person who in the Persons Table persons can take a Maths Class in
the grade_maths ; So we ask our Database like performed in the commands bellow;
Another JOIN is we ask our Database to show us the result of List the students from
Persons table that take IT Subject, so our command will be as stated as bellow;
It shows that only 1(one) person in Students Database from the table Persons that take IT
Class in the with the name ;’Cristie Wills’.
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
We also can check in the Table of grade_it and persons to confirm our result;
2022-07-12
DATABASE DEVELOPMENT LIVE CODING TEST; HR SYSTEM
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
MariaDB [hrsystem]> ALTER TABLE categoria ADD FOREIGN KEY(id_func) REFERENCES
funcionario(id_func);
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
This is happened when we ALTER TABLE categoria id_func to FOREIGN KEY(picture bellow)
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento
MariaDB [hrsystem]> SELECT funcionario.id_func, funcionario.naran, funcionario.helafatin,
funcionario.no_telefone, funcionario.email, categoria.kargu_func, categoria.municipio,
categoria.id_cat FROM funcionario CROSS JOIN categoria ON
funcionario.id_func=categoria.id_func;
Database Project using MySQL, PHP, HTML, CSS, JavaScript & Bootstrap Database Development Project
CLI(MariaDB), XAMPPControlPanel, Notepad++, VisualStudioCode & Internet Browsing Apps Guido Sarmento