0% found this document useful (0 votes)
9 views16 pages

DB Inter To Website

The document explains the differences between a database and a website, highlighting that a database is a structured collection of data managed by a Database Management System (DBMS), while a website consists of web pages accessible via the internet. It discusses the benefits of integrating a database with a website to enhance interactivity and data management, providing examples of applications such as product listings and employee directories. Additionally, the document includes code snippets for various web applications related to student registration and management using PHP and MySQL.

Uploaded by

hiti protogene
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views16 pages

DB Inter To Website

The document explains the differences between a database and a website, highlighting that a database is a structured collection of data managed by a Database Management System (DBMS), while a website consists of web pages accessible via the internet. It discusses the benefits of integrating a database with a website to enhance interactivity and data management, providing examples of applications such as product listings and employee directories. Additionally, the document includes code snippets for various web applications related to student registration and management using PHP and MySQL.

Uploaded by

hiti protogene
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 16

DATABASE INTEGRATION TO WEBSITE

Difference between a Database and a Website

Database

Database – a database is a collection of data (tables, queries, reports, views and other objects)
that are typically organized to provide information or support processes requiring information
like going through hotel vacancies online (applications will run through the vacancy report from
the database and will return results to the user).
It is basically a structured data storage that can be accessed through a set of computer software
that allows users to make these data interact, provided by a DBMS or Database Management
System. This DBMS will also provide other various functions that allow data entry, storage, and
provide data management.

As a physical database, these are dedicated servers containing the actual data provided and
organized by the DBMS. These are usually multiprocessor systems with lots of memory and of
course generous RAID (data storage virtualization combining multiple physical disk drives into a
single logical unit for a better performance) disk arrays used for stable storage.

Website

A Website – known simply as a site, is a set of web pages that generally serves a single web
domain. It is hosted by a web server and will be accessible via the internet or private LAN (local
area network) by means of an internet address known as an URL (uniform resource locator).
These web pages, which are the building blocks of a website, are usually written in plain text that
will go through the formatting instructions of Hypertext Markup Language (HTML, XHTML). A
web browser will then render the page content according to its HTML markup instructions onto a
display terminal or monitor, which now will be what the ‘SITE” will look like. Web pages are
accessed and are transported with the HTTP or Hypertext Transfer Protocol, or to a secure one,
the HTTP secure (HTTPS) for better security and privacy for users. This is why most financial-
involved websites use the HTTPS instead of the HTTP.
Comparison
Database Website

Organized collection of data Set of web pages

Information from a database will be required by a Will require information from a database
set of instructions from a website depending on the instructions

Will run online or offline Will run online


Database Integration on your website

One way to utilize a large quantity of data is to integrate your website with a database. This can
make your website more interactive and informative to prospective customers, both publishing
and collecting data. Common examples of data integrated websites are:

Systems can be based on Microsoft Access databases (limited number of users at one time) to
SQL databases (providing a faster, more flexible back-end) to simple data tables. Legacy
systems that you are using in your company today may also be integrated into web-based
systems.

Some Possible Database Web Applications

Think about all the things your website could do with a database integrated back-end:

 List your products (i.e., real estate listings, e-commerce products, etc.) for prospective
customers to view
 Customers can make appointments online for consultations

 Lists of office locations linked to maps

Private Areas of your website can have databases integrated into them as well:

 Show your employees possible vacation days


 Company directories

 Job applicants -attached resumes, notes, etc.

 Employee assignments & schedules

 Sales order reports

 Supply chain data

Data integrated systems can make managing data on the web a breeze. To find your customized
solution for the web, contact us today!
EXERCISES’ CODES

DATABASE CREATED

LOGIN FORM

<html>

<head>

<title>LEVEL 4 SOFTWARE DEVELOPMENT</title>

</head>

<body bgcolor="#FFFF00">

<br /><br /><br />

<form action="" method="post">

<table align="center" bgcolor="#9999CC">

<tr><td>User Name:</td><td><input type="text" name="u" /></td></tr>

<tr><td>Password:</td><td><input type="password" name="p" /></td></tr>

<tr><td></td><td><input type="submit" name="log" value="Login" /></td></tr>


</table>

</form>

<center>

<?php

if(isset($_REQUEST['log']))

$x=mysql_connect("localhost","root","");

mysql_select_db("level",$x);

$a=$_POST['u'];

$b=$_POST['p'];

$q=mysql_query("select * from login") or die("".mysql_error());

while($r=mysql_fetch_array($q))

$z=$r['username'];

$y=$r['password'];

if($a==$z and $b==$y)

echo"<a href='student.php'>OPEN STUDENT FORM</a>";

else

echo"User Name or password incorrect!";


}

?>

</center>

</body>

</html>

STUDENT REGISTRATION

<html>

<head>

<title>LEVEL 4 SOFTWARE DEVELOPMENT</title>

</head>

<body>

<br /><br />

<form action="" method="post">

<table align="center" bgcolor="#9999CC">

<tr><td>Student Name:</td><td><input type="text" name="n" /></td></tr>

<tr><td>Gender:</td><td><select name="g"><option>Select
Gender</option><option>Male</option><option>Female</option></select></td></tr>

<tr><td>Class:</td><td><select name="c"><option>Select
Class</option><option>S1</option><option>S2</option><option>S3</option><option>S4</
option><option>S5</option><option>S6</option></select></td></tr>

<tr><td></td><td><input type="submit" name="sv" value="Save" /></td></tr>


</table>

</form>

<?php

if(isset($_REQUEST['sv']))

$x=mysql_connect("localhost","root","");

mysql_select_db("level",$x);

$a=$_POST['n'];

$b=$_POST['g'];

$c=$_POST['c'];

$sql=mysql_query("insert into student(snumber,names,gender,class)values(Null,'$a','$b','$c')");

if($sql)

echo"Well saved";

else

echo"Not saved";

?>

</body>

</html>
STUDENT TABLE

<html>

<head>

<title>LEVEL 4 SOFTWARE DEVELOPMENT</title>

</head>

<body>

<form action="" method="post">

<table align="center" border="20" bordercolor="#003333"><tr><td>


<table align="center" bgcolor="#9999FF">

<tr><td>Student Number:</td><td><input type="text" name="sn" required /></td></tr>

<tr><td>Student Names:</td><td><input type="text" name="sm" required/></td></tr>

<tr><td>Student Gender:</td><td><select name="gd"><option>Select your


gender</option><option>Male</option><option>Female</option></select></td></tr>

<tr><td>Student Combination:</td><td><select name="cb"><option>Select your


combination</option><option>L4 SD</option><option>L4 ETRO</option></select></td></tr>

<tr><td>Student Class:</td><td><select name="cs"><option>Select your


class</option><option>S1</option><option>S2</option></select></td></tr>

<tr><td>Student Email:</td><td><input type="text" name="sg" required/></td></tr>

<tr><td></td><td><input type="submit" value="Save" name="sv" /><input type="reset"


value="Cancel"/> </td></tr>

</table>

</td></tr></table>

</form>

<?php

if(isset($_REQUEST['sv']))

$con=mysql_connect("localhost","root","");

mysql_select_db("school",$con);

$a=$_POST['sn'];

$b=$_POST['sm'];

$c=$_POST['gd'];

$d=$_POST['cb'];

$e=$_POST['cs'];

$f=$_POST['sg'];
$sql=mysql_query("insert into
student(snumber,snames,sgender,combination,class,email)values('$a','$b','$c','$d','$e','$f')");

if($sql)

echo"Well saved";

else

echo"Try again!";

?>

</body>

</html>

UPDATE STUDENT INFO

<form action="" method="post">

<table align="center" bgcolor="#9999CC">

<tr><td>Student Name:</td><td><input type="text" name="n" /></td></tr>


<tr><td>Gender:</td><td><select name="g"><option>Select
Gender</option><option>Male</option><option>Female</option></select></td></tr>

<tr><td>Class:</td><td><select name="c"><option>Select
Class</option><option>S1</option><option>S2</option><option>S3</option><option>S4</
option><option>S5</option><option>S6</option></select></td></tr>

<tr><td></td><td><input type="submit" name="up" value="Update" /></td></tr>

</table>

</form>

<?php

if(isset($_REQUEST['up']))

$x=mysql_connect("localhost","root","");

mysql_select_db("level",$x);

$a=$_POST['n'];

$b=$_POST['g'];

$c=$_POST['c'];

$sql=mysql_query("update student set gender='$b', class='$c' where names='$a'") or


die("".mysql_error());

if($sql)

echo"Well Updated";

else

{
echo"Not Updated";

?>

DELETE ALL STUDENT INFO

<form action="" method="post"> <input type="submit" value="Delete All" name="dl" />


</form>

<?php

if(isset($_REQUEST['dl']))

$con=mysql_connect("localhost","root","");

mysql_select_db("school",$con);

$sql=mysql_query("delete from student");

if($sql)

echo"Well deleted";

else

echo"Try again!";

}
}

?>

DELETE ONE STUDENT INFO

<form action="" method="post">

<table><tr><td><input type="text" name="d" /> <input type="submit" value="Delete


One Record" name="ddl" /></td></tr></table>

</form>

<?php

if(isset($_REQUEST['ddl']))

$con=mysql_connect("localhost","root","");

mysql_select_db("school",$con);

$xx=$_POST['d'];

$sql=mysql_query("delete from student where snumber='$xx'");

if($sql)

echo"Well deleted";

else

echo"Try again!";

}
?>

DISPLAY STUDENT INFO

<form action="" method="post">

<input type="submit" value="Display database info" name="sh"/>

</form>

<table
border="1"><th>NUMBER</th><th>NAMES</th><th>GENDER</th><th>COMBINATION<
/th><th>CLASS</th><th>EMAIL</th>

<?php

if(isset($_REQUEST['sh']))

$con=mysql_connect("localhost","root","");

mysql_select_db("school",$con);

$sql=mysql_query("select * from student");

while($row=mysql_fetch_array($sql))

echo"<tr><td>".$row['snumber']."</td>";

echo"<td>".$row['snames']."</td>";

echo"<td>".$row['gender']."</td>";

echo"<td>".$row['combination']."</td>";

echo"<td>".$row['class']."</td>";

echo"<td>".$row['email']."</td></tr>";

}
}

?>

</table>

SEARCH ONE RECORD FROM DATABASE

<form action="" method="post">

<table><tr><td><input type="text" name="scc" /> <input type="submit" value="Search One


Record" name="search" /></td></tr></table>

</form>

<table
border="1"><th>NUMBER</th><th>NAMES</th><th>GENDER</th><th>COMBINATION<
/th><th>CLASS</th><th>EMAIL</th>

<?php

if(isset($_REQUEST['search']))

$con=mysql_connect("localhost","root","");

mysql_select_db("school",$con);

$sss=$_POST['scc'];

$sql=mysql_query("select * from student where snumber='$sss'");

while($row=mysql_fetch_array($sql))

echo"<tr><td>".$row['snumber']."</td>";

echo"<td>".$row['snames']."</td>";
echo"<td>".$row['sgender']."</td>";

echo"<td>".$row['combination']."</td>";

echo"<td>".$row['class']."</td>";

echo"<td>".$row['email']."</td></tr>";

?>

</table>

PRINT STUDENT REPORT

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Software Development</title>

<script type="text/javascript">

function print_page() {

var ButtonControl = document.getElementById("btnprint");

ButtonControl.style.visibility = "hidden";

window.print();

</script>

</head>

<body>

<?php
$x=mysql_connect("localhost","root","");

mysql_select_db("level",$x);

$a=$_POST['n'];

echo"<br><br>";

$sql=mysql_query("select * from student where names='$a'") or die("".mysql_error());

while($r=mysql_fetch_array($sql))

echo"<table border=1 align=center bgcolor='pink'> <th>Number</th> <th>Names</th>


<th>Gender</th> <th>Class</th><th>Dates</th><th>Amount</th>";

echo"<tr>";

echo"<td>".$r['snumber']."</td>";

echo"<td>".$r['names']."</td>";

echo"<td>".$r['gender']."</td>";

echo"<td>".$r['class']."</td>";

echo"<td>".$r['dates']."</td>";

echo"<td>".$r['amount']."</td>";

echo"</tr></table>";

?>

<br /><br />

<center><input name="image" type="image" id="btnprint" onclick="print_page()"


src="x.jpg" width="225" height="50" /></center>

</body>

</html>

You might also like