Sunteți pe pagina 1din 28

[Type a quote from the document or

the summary of an interesting point.


You can position the text box anywhere
A in the document. Use the Text Box
Tools tab to change the formatting of
Training Report the pull quote text box.]

Of
Summer Training
Project At

On
PHP WITH MY SQL
Submitted
In The Partial Fulfillment of
Bachelor of Technology
Department of Computer Science & Engineering/Information
Technology
United College Of Engineering And Management
2019-20

Submitted to : Submitted by:


Mr. Himanshu Srivastava Name :Rituraj Sharma
Assistant Professor B.Tech (CS):4th yr
Department of Computer Science & Semester : 7
Information Technology Roll No : 1634210055
United College Of Engineering and Management

1
Certificate

I am Shubhangi Sahu, student of B.Tech (IT), 4th year of United College Of Engineering and
Management, Naini completed my summer training from United for 15 days during June 2019.
During the mentioned period I worked at PHP with My sql and completed my summer training
project entitled”Online Transportation Management and E-Bus Pass System” under the guidance
of Mr.Dhananjay Sharma.

Date: Name:Shubhangi Sahu


[Type a quote from the document or
the summary of an interesting point.
Acknowledgement You can position the text box
anywhere in the document. Use the
Text Box Tools tab to change the
formatting of the pull quo
“Gratitude is not a thing of expression; it is more matter of feeling."

There is always a sense of gratitude which one express towards others for their help and supervision in
achieving the goals. This formal piece of acknowledgement is an attempt to express the feeling of
gratitude towards people who helpful me in successfully completing of my training

I would like to express my deep gratitude to Mr. Vikrant Singh ,my training coordinator for their constant
co-operation. He was always there with his competent guidance and valuable suggestion throughout the
pursuance of this research project.

I would also like to place of appreciation to all the respondents and group members whose responses and
coordination were of utmost importance for the project.

Above all no words can express my feelings to my parents, friends all those persons who supported me
during my project. I am also thankful to all the respondents whose cooperation & support has helped me
a lot in collecting necessary information

3
TABLE OF CONTENTS

1. Certificate------------------------- 2

2. Acknowledgment------------------3

3.Company Profle…………………5

4.Technology………………………6-23

4.1 HTML……………………… 6

4.2 CSS……………………………7

4.3 JavaScript…………………… 8

4.4 Bootstrap…………………… 9-11

4.5 PHP with MYSQL…………… 12-23

5. Project…………………………… 24-27

5.1 Role of Entities………………24

5.2 Module Description……………25-27

6. References………………………… 28

4
COMPANY PROFILE

The United Group , founded by late Shri Shiv Ram Das Gulati in
1951 emerged from a transport business to the giants in the fields of
education, services, transportation and journalism. The group made a mammoth
leap in the education arena in the mid 80s by being the pioneers in computer
education.
Now, with 08 well established institutes in Allahabad and Greater Noida, over
11200 students and more than 750 faculty members, the United Group of
Institutions is poised to reach the next level providing the best technical
education. Our establishment offers NBA accredited courses, Quality recognised
by the World Bank and boasts of more than 14000 alumni base.
All the Institutions are affiliated to AKTU, Lucknow and approved by All India
Council for Technical Education (AICTE), Ministry of Human Resources
Development, Government of India, New Delhi.
United Institutes works on the motto of holistic education of its students. Hence
every measure is taken that their progress does not remain constrained to the
classrooms. Ample scope for extracurricular activities along with classroom
syllabus keeps the student at par with the best of the institutes.
Special care is given to the courses of the student which demand industrial
trainings and visit.
The Naini industrial area provides the perfect opportunity for the students to gain
hands on
experience and getting to know the grooves of the industry.
\

5
TECHNOLOGY

Introduction to html-
1. HTML stands for HyperText Markup Language.
2. It is a client side programming languages.
3. The extention of HTML may be .htm or .html
4. It is not a case sensitive language
5. it is a Tag based language, & the tags could be classified into two types
a) single tag (<tag> or <tag/>) ex. <br>,<hr>
b) paired tag (<tag>.....</tag>) ex <html>,<body> etc
6. you can write html program on any editor like notepad, but some specific
IDEs are-
a) Dreamweaver
b) FrontPage
7. It executes on a web browser.
Basic HTML Tags-
<html>- indicates starting of a html program
<head>- it is container tag contains <title>,<script>,<style> etc
<title>- sets the title of a page
<body>- specifies the contents of a page
Text Formatting Tags-
<h1>...<h6>- They specifies the heading
<font> - sets the font color & style
<hr>- draw the horizontal line, it is a single tag
<br>- change a line, it is also a single tag
<b>- Bold
<i>- Italic
<u>- Ubderline
<big>- Big Text
<small>- Small Text
<pre>- pre formatted Text
<sup> - Superscript
<sub>- Subscript
<p>- Paragraph

6
Css-

It is used for formatting the contents of a page,like heading style,font style etc
2. You can control the whole design of a website using css.
3. The extenton of CSS must be .css
Type of CSS- It could be classified into 3 types-
1. inline style
2. <style> tag
3. cascading style sheet(.css)

inline style- it allows you for specifiying the style of the content just inside the
tag.Syntax will be-

<tagname style="attribute-name:value;.....">Tag Content</tag>


<style> tag- It is used for specifying a common style for whole the page.
Cascading Stylesheet- It is used for creating a common style for whole the
website.It is saved in a seperate file with .css extention.
CSS Example
body
{
background-color:maroon;
}
table
{
font-family:arial;
font-size:24px;
background-color:white;
}
hr
{
color:black;
}
.title
{
font-family:impact; color:green; font-size:35px;
}
.footer
{
background-color:maroon; color:white;

7
JAVA SCRIPT-

1. JavaScript was designed to add interactivity to HTML pages


2. JavaScript is a scripting language
3. A scripting language is a lightweight programming language
4. JavaScript is usually embedded directly into HTML pages
5. It is used for client side operations like validation, animation etc.

Variable- for declaring a variable you can follow the following syntax-
var variable_name;
Javascript is a loosly typed programming language, means you can use a variable
without its declarion.by default it contains object type values but for conversion
you can use-
parseInt()
parseFloat()
parseDouble()

Operators-
1. Assignment Operator(=)
2. Arithmetical Operator(+,-,*,/,%)
3. Relational Operator(<,<=,>,>=,==,!=)
4. Logical Operator(&&,||,!)
5. Increment/Decrement Operator(++,--)
6. Conditional Operator(?:)

Some Built in Functions-


1. alert()- this function is used for showing a message
2. prompt()- this method is used for reading any value
3. confirm()- this method is used for confirmation message

Events-

Events are the actions which indicates happening of any operation.Some most
frequently used events are-
Onload- fires when the page is loaded
Onunload- fires when the page unload from browser
onClick-fires when object is cliked
Onblur- when the focus goes out
Onfocus- when the focus comes in
Onchange- when the value is changed
8
Bootstrap-

Bootstrap is a powerful toolkit - a collection of HTML, CSS, and JavaScript tools


for creating and building web pages and web applications. It is a free and open
source project, hosted on Github, and originally created by (and for) Twitter.After
its open source release in 2011, Bootstrap became popular very quickly, and not
without reason. Web designers and web developers like Bootstrap because it is
flexible and easy to work with. Its main advantages are that it is responsive by
design, it maintains wide browser compatibility, it offers consistent design by
using re-usable components, and it is very easy to use and quick to learn. It offers
rich extensibility using JavaScript, coming with built-in support for jQuery plugins
and a programmatic JavaScript API. Bootstrap can be used with any IDE or editor,
and any server side technology and language, from ASP.NET to PHP to Ruby on
Rails.With Bootstrap, web developers can concentrate on the development work,
without worrying about design, and get a good looking website up and running
quickly. Conversely, it gives web designers a solid foundation for creating
interesting Bootstrap themes.

BOOTSTRAP GRID SYSTEM-

This responsiveness is achieved using a fluid Bootstrap grid system that can be
applied to appropriately scale up to 12 columns according to the size of the device
or viewport. Grids provide structure to the layout, defining the horizontal and
vertical guidelines for arranging content and enforcing margins. Grids also offer an
intuitive structure for viewers, because it’s easy to follow a left to right, or a right
to left flow of content moving down the page. Before grids, and before CSS was so
powerful, grid based layouts were achieved by using tables, where the content
would be arranged inside table cells. As CSS became more mature, a number of
CSS frameworks for grid-based layouts started to appear. These include YUI
grids, 960 GS and blueprint, to name a few.

BOOTSTRAP TYPOGRAPHY-

Bootstrap brings some more goodies to table besides pure CSS reset. It comes
with normalize.css, an HTML5-ready alternative to CSS resets, and it also has
some well-designed defaults of its own.

9
For example, Bootstrap sets the global default font-size to 14px, with a line-
height of 1.428. The default font is changed to Helvetica/Arial, with sans serif
fallback.

All these styles are applied to the <body> and all paragraphs, with the addition
that <p> (paragraphs) receive a bottom margin of half their computed line-height
(10px by default). Besides these defaults, there are also customizable styles for
standard HTML tags that bring more consistency to the text, such as highlighted
text ( <mark> ), deleted text ( <del> and <s> ), underlined text ( <u> ), small text
( <small> ), and bold text ( <strong> ). Alignment classes help to arrange content
on the page more easily by using .text-left , .text-center , .text-right , .text-
justify and .text-nowrap classes. There are also predefined styles for block
quotes, and unordered and ordered list, with inline options, just to name a few.

FORMS-
Forms have come a long way over the years, and today using a web form is one of
the most common activities performed while browsing the web. While HTML5
introduced a number of new form attributes, input types, and other helper elements,
browsers haven’t visually improved forms much. This is one area where Bootstrap
really shines, because aligning and styling labels and inputs, validating forms, and
showing error messages, can be tricky without some help.First, Bootstrap sets all
textual input elements, like <input> , <textarea> , and <select> , to 100% width
of the parent form element. It also gives you the ability to choose between inline
forms, which will render multiple labels and input fields in the same line, by using
the .form-inline class, or horizontal forms, which use grids to align each input in
its own row, by using the .form-horizontal class. And if you need to place plain
text next to a form label, instead of the input field, you can give it the .form-
control-static class to make it match the visual look of the form.

10
Buttons, Button Groups, and Button Dropdowns-

Buttons are one of the things every browser renders totally differently. If you want
to have consistent design across all browsers, this is potentially a big problem.
Luckily, Bootstrap has an elegant solution for buttons also. And besides making
them consistent, it brings a lot of variations to play with. You can apply
the .btn class to <a> and <input> elements. You can group a series of
buttons together into a single line using the .btn-group class on the parent <div> .
With a little help from JavaScript, you can create radio- and checkbox- style
behavior on buttons. Or you can turn your buttons into dropdown menus by
placing it within a .btn-group , and providing the proper menu markup of
unordered list of items.

Navbars-

The navigational bar, or navbar, is a Bootstrap component designed specifically to


build the primary navigation menu of the website. On big screens, it is displayed
horizontally, and on small and mobile screens (those below 768px), it transformed
into a “hamburger” dropdown menu. Under the hood, navbar is an unordered inline
list of menu items, with additional HTML elements that are added as desired.
Among the possible additions are branding (either text or logo), form items such as
a search bar, and menu dropdowns. Two styles are available to choose from out-of-
the-box: light and dark, inverted. Items in the navbar can be aligned left or right by
applying .navbar-left or .navbar-right classes, respectively.Navbars can have 4
different position behaviors. The default float position has buffer space around it;
the full-width static navbar scrolls away when the user scrolls down the page, and
the fixed navbar, which can be either on the top or the bottom of the window, is
always visible on the page, no matter where the user has scrolled to.

11
Php with mysql-

PHP is a server-side, HTML-embedded scripting language that may be used to


create dynamic Web pages. It is available for most operating systems and Web
servers, and can access most common databases, including MySQL. PHP may be
run as a separate program or compiled as a module for use with a Web server.
Depending on the version of PHP, there are either two or three PHP APIs for
accessing the MySQL database.

What is an API?
An Application Programming Interface, or API, defines the classes, methods,
functions and variables that your application will need to call in order to carry out
its desired task. In the case of PHP applications that need to communicate with
databases the necessary APIs are usually exposed via PHP extensions.
When writing PHP applications that need to connect to the MySQL server there are
several API options available. This document discusses what is available and how
to select the best solution for your application.

What is a Connector?
In the MySQL documentation, the term connector refers to a piece of software that
allows your application to connect to the MySQL database server. MySQL
provides connectors for a variety of languages, including PHP. If your PHP
application needs to communicate with a database server you will need to write
PHP code to perform such activities as connecting to the database server, querying
the database and other databaserelated functions. Software is required to provide
the API that your PHP application will use, and also handle the communication
between your application and the database server, possibly using other
intermediate libraries where necessary. This software is known generically as a
connector, as it allows your application to connect to a database server. What is a
Driver? A driver is a piece of software designed to communicate with a specific
type of database server. The driver may also call a library, such as the MySQL
Client Library or the MySQL Native Driver. These libraries implement the low-
level protocol used to communicate with the MySQL database server.

php variable-

In PHP, a variable starts with the $ sign, followed by the name of the variable.

12
Php datatypes-

Variables can store data of different types, and different data types can do different
things.PHP supports the following data types:

• String
• Integer
• Float (floating point numbers - also called double)
• Boolean
• Array
• Object
• NULL
• Resource

PHP STRING-

A string is a sequence of characters, like "Hello world!".A string can be any text inside
quotes. You can use single or double quotes

PHP INTERGER-

An integer data type is a non-decimal number between -2,147,483,648 and


2,147,483,647.Rules for integers:

• An integer must have at least one digit


• An integer must not have a decimal point
• An integer can be either positive or negative
• Integers can be specified in: decimal (base 10), hexadecimal (base 16), octal
(base 8), or binary (base 2) notation

PHP FLOAT-
A float (floating point number) is a number with a decimal point or a number in
exponential form.
PHP BOOLEAN-

A Boolean represents two possible states: TRUE or FALSE.

$x = true;

13
$y = false;

Booleans are often used in conditional testing. You will learn more about
conditional testing in a later chapter of this tutorial.

PHP ARRAY-

An array stores multiple values in one single variable.

PHP OBJECT-

An object is a data type which stores data and information on how to process that
data.In PHP, an object must be explicitly declared.First we must declare a class of
object. For this, we use the class keyword. A class is a structure that can contain
properties and methods.

PHP NULL VALUE-

Null is a special data type which can have only one value: NULL.A variable of
data type NULL is a variable that has no value assigned to it. If a variable is
created without a value, it is automatically assigned a value of NULL.

PHP RESOURCES-

The special resource type is not an actual data type. It is the storing of a reference
to functions and resources external to PHP.A common example of using the
resource data type is a database call.

PHP OPERATORS-

Operators are used to perform operations on variables and values.

PHP divides the operators in the following groups:

• Arithmetic operators
• Assignment operators
• Comparison operators
• Increment/Decrement operators
• Logical operators
• String operators
• Array operators
14
• Conditional assignment operators

PHP Assignment Operators-

The PHP assignment operators are used with numeric values to write a value to a
variable.The basic assignment operator in PHP is "=". It means that the left
operand gets set to the value of the assignment expression on the right.

Assignment Same Description


as...

x=y x=y The left operand gets set to the value of the
expression on the right

x += y x=x+y Addition

x -= y x=x-y Subtraction

x *= y x=x*y Multiplication

x /= y x=x/y Division

x %= y x=x%y Modulus

15
PHP Comparison Operators

The PHP comparison operators are used to compare two values (number or string):

Operator Name Example Result

== Equal $x == $y Returns true if $x is


equal to $y

=== Identical $x === Returns true if $x is


$y equal to $y, and they
are of the same type

!= Not equal $x != $y Returns true if $x is


not equal to $y

<> Not equal $x <> $y Returns true if $x is


not equal to $y

!== Not $x !== Returns true if $x is


identical $y not equal to $y, or
they are not of the
same type

> Greater $x > $y Returns true if $x is


than greater than $y

< Less than $16 < $y Returns true if $x is


less than $y
>= Greater $x >= $y Returns true if $x is
than or greater than or equal
equal to to $y

<= Less than $x <= $y Returns true if $x is


or equal to less than or equal to
$y

<=> Spaceship $x <=> Returns an integer less


$y than, equal to, or
greater than zero,
depending on if $x is
less than, equal to, or
greater than $y.
Introduced in PHP 7.

PHP Increment / Decrement Operators


The PHP increment operators are used to increment a variable's value.The PHP
decrement operators are used to decrement a variable's value.

Operator Name Description

++$x Pre-increment Increments $x by one, then returns $x

$x++ Post-increment Returns $x, then increments $x by one

--$x Pre-decrement Decrements $x by one, then returns $x


$x-- Post-decrement Returns $x, then decrements $x by
one

PHP Logical Operators


The PHP logical operators are used to combine conditional statements.

Operator Name Example Result

and And $x and $y True if both $x and $y are true

or Or $x or $y True if either $x or $y is true

xor Xor $x xor $y True if either $x or $y is true, but not


both

&& And $x && $y True if both $x and $y are true

|| Or $x || $y True if either $x or $y is true

! Not !$x True if $x is not true

PHP String Operators


PHP has two operators that are specially designed for strings.
. Concatenation $txt1 . $txt2 Concatenation of $txt1 and
$txt2

.= Concatenation $txt1 .= Appends $txt2 to $txt1


assignment $txt2

PHP Array Operators


The PHP array operators are used to compare arrays.

Operator Name Example Result

+ Union $x + $y Union of $x and $y

== Equality $x == $y Returns true if $x and $y have the same


key/value pairs

=== Identity $x === $y Returns true if $x and $y have the same


key/value pairs in the same order and of the
same types

!= Inequality $x != $y Returns true if $x is not equal to $y

PHP Conditional Assignment Operators


The PHP conditional assignment operators are used to set a value depending on
conditions:

19
Operator Name Example Result

?: Ternary $x Returns the value of $x.


= expr1 ? expr2 : expr3 The value of $x
is expr2 if expr1 =
TRUE.
The value of $x
is expr3 if expr1 =
FALSE

?? Null $x = expr1 ?? expr2 Returns the value of $x.


coalescing The value of $x
is expr1 if expr1 exists,
and is not NULL.
If expr1 does not exist,
or is NULL, the value of
$x is expr2.
Introduced in PHP 7

PHP CONDITIONAL STATEMENTS-


Very often when you write code, you want to perform different actions for
different conditions. You can use conditional statements in your code to do this.

In PHP we have the following conditional statements:

• if statement - executes some code if one condition is true


• code if that condition is false
• if...elseif...else statement - executes different codes for more than two
conditions
• switch statement - selects one of many blocks of code to be executed.

20
PHP LOOPS-
Often when you write code, you want the same block of code to run over and over
again a certain number of times. So, instead of adding several almost equal code-
lines in a script, we can use loops.

Loops are used to execute the same block of code again and again, as long as a
certain condition is true.In PHP, we have the following loop types:

• while - loops through a block of code as long as the specified condition is


true
• do...while - loops through a block of code once, and then repeats the loop as
long as the specified condition is true
• for - loops through a block of code a specified number of times
• foreach - loops through a block of code for each element in an array

MY SQL-
• MySQL is a database system used on the web
• MySQL is a database system that runs on a server
• MySQL is ideal for both small and large applications
• MySQL is very fast, reliable, and easy to use
• MySQL uses standard SQL
• MySQL compiles on a number of platforms
• MySQL is free to download and use
• MySQL is developed, distributed, and supported by Oracle Corporation
• MySQL is named after co-founder Monty Widenius's daughter: My

The data in a MySQL database are stored in tables. A table is a collection of


related data, and it consists of columns and rows.

DATABASE QUERIES-
A query is a question or a request.We can query a database for specific information
and have a recordset returned.

21
MYSQL CONNECT –

Before we can access data in the MySQL database, we need to be able to connect
to the server:

<?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);
}
echo "Connected successfully";
?>

MYSQL FUNCTIONS-
• mysql_affected_rows — Get number of affected rows in previous MySQL
operation
• mysql_client_encoding — Returns the name of the character set
• mysql_close — Close MySQL connection
• mysql_connect — Open a connection to a MySQL Server
• mysql_create_db — Create a MySQL database
• mysql_data_seek — Move internal result pointer
• mysql_db_name — Retrieves database name from the call to mysql_list_dbs
• mysql_db_query — Selects a database and executes a query on it
• mysql_drop_db — Drop (delete) a MySQL database
• mysql_errno — Returns the numerical value of the error message from
previous MySQL operation
• mysql_error — Returns the text of the error message from previous MySQL
operation
• mysql_escape_string — Escapes a string for use in a mysql_query
• mysql_fetch_array — Fetch a result row as an associative array, a numeric
array, or both
• mysql_fetch_assoc — Fetch a result row as an associative array
• mysql_fetch_field — Get column information from a result and return object
22
• mysql_fetch_lengths — Get the length of each output in a result
• mysql_fetch_object — Fetch a result row as an object
• mysql_fetch_row — Get a result row as an enumerated array
• mysql_field_flags — Get the flags associated with the specified field in a
result
• mysql_field_len — Returns the length of the specified field
• mysql_field_name — Get the name of the specified field in a result
• mysql_field_seek — Set result pointer to a specified field offset
• mysql_field_table — Get name of the table the specified field is in
• mysql_field_type — Get the type of the specified field in a result
• mysql_free_result — Free result memory
• mysql_get_client_info — Get MySQL client info
• mysql_get_host_info — Get MySQL host info
• mysql_get_proto_info — Get MySQL protocol info
• mysql_get_server_info — Get MySQL server info
• mysql_info — Get information about the most recent query
• mysql_insert_id — Get the ID generated in the last query
• mysql_list_dbs — List databases available on a MySQL server
• mysql_list_fields — List MySQL table fields
• mysql_list_processes — List MySQL processes
• mysql_list_tables — List tables in a MySQL database
• mysql_num_fields — Get number of fields in result
• mysql_num_rows — Get number of rows in result
• mysql_pconnect — Open a persistent connection to a MySQL server
• mysql_ping — Ping a server connection or reconnect if there is no
connection
• mysql_query — Send a MySQL query
• mysql_real_escape_string — Escapes special characters in a string for use in
an SQL statement
• mysql_result — Get result data
• mysql_select_db — Select a MySQL database
• mysql_set_charset — Sets the client character set
• mysql_stat — Get current system status
• mysql_tablename — Get table name of field
• mysql_thread_id — Return the current thread ID
• mysql_unbuffered_query — Send an SQL query to MySQL without fetching
and buffering the result row

23
PROJECT

Object
Online House Renting System

Conceptual Models

• ER Diagram

24
• Data Flow diagram

25
• Level 1 DFD

26
MODULE DESCRIPTION

The project is divided into Following modules respectively-


• Registration/Login Module
• Booking Module
• House Posting Module
• Feedback and Contact Module

Registration/login-

The Online House Rental System in Registration Modules is used to collect the
personal information. It has to collect the address, name, phone number also. The
registration modules details are stored in the database.

booking-

Online House Rental System has an implementation of house booking where only
registerd number are allowed to view and book house /office/land/home for rentel
or lease.

Post house module-

House Rental System has been implemented with house posting module where the
seller/landlord or system administrator can upload house/property details for sale
or rent.

27
REFERENCES

• https://resgroup.net/house renting system/


• .https://geeks for geeks.co/php with msql/
• www.google.com/html/php/javascript/cc/web/database

28

S-ar putea să vă placă și