Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

"PHP and SQL Notes

Rating
-
Sold
-
Pages
107
Uploaded on
09-06-2023
Written in
2022/2023

"PHP and SQL Notes: Comprehensive Guide for Web Development" This document provides a concise yet comprehensive guide on PHP and SQL, covering key concepts, syntax, and best practices for web development. Whether you're a beginner or an experienced developer, this resource offers valuable insights to enhance your PHP and SQL skills. With clear explanations and practical examples, it's the go-to reference for mastering these fundamental technologies. Accelerate your learning and unlock the potential of PHP and SQL with this knowledge-packed document.

Show more Read less
Institution
Course

Content preview

STUDY MATERIAL FOR B.SC (CS)
PROGRAMMING WITH PHP & MYSQL




Syllabus

Unit-1: The Building blocks of PHP: Variables, Data Types, Operators and Expressions, Constants.Flow Control
Functions in PHP: Switching Flow, Loops, Code Blocks and Browser Output.Working with Functions: What is
function?, Calling functions, Defining Functions, Returningthe values from User-Defined Functions, Variable Scope,
Saving state between Function callswiththestatic statement, moreabout arguments.
Unit-2: Working with Arrays: What are Arrays? Creating Arrays, Some Array-Related Functions.Working with
Objects: Creating Objects, Object Instance Working with Strings, Dates andTime: Formatting strings with PHP,
Investigating Strings with PHP, Manipulating StringswithPHP, UsingDate and TimeFunctions in PHP.
Unit-3: Working with Forms: Creating Forms, Accessing Form Input with User defined Arrays,Combining HTML
andPHP code on a single Page, Using Hidden Fields to save state,Redirecting the user, Sending Mail on Form
Submission, and Working with File Uploads.Working with Cookies and User Sessions: Introducing Cookies, Setting a
Cookie with PHP,Session Function Overview, Starting a Session, Working with session variables,
passingsessionIDsintheQueryString,DestroyingSessionsandUnsettingVariabl es,UsingSessionsin an Environment with
Registered Users.

Unit-4: Working with Files and Directories: Including Files with inclue(), Validating Files, Creatingand Deleting Files,
Opening a File for Writing, Reading or Appending, Reading from Files,Writing or Appending to a File, Working with
Directories,OpenPipestoandfromProcessUsingpopen(),RunningCommandswit
hexec(),RunningCommandswithsystem()orpassthru().Working with Images: Understanding the Image-Creation
Process, Necessary Modificationsto PHP, Drawing a New Image, Getting Fancy with Pie Charts, Modifying Existing
Images,ImageCreation from UserInput. Unit-5: (10hours) Interacting with MySQL using PHP: MySQL Versus MySQLi
Functions, Connecting toMySQL with PHP, Working with MySQL Data.




Page 1 of 91

, STUDY MATERIAL FOR
IIIB.SC (CS)PHP & MYSQL
Table of Contents
Unit I
What is PHP?, History, Features 3
PHP statements and comments 5
Variables 6
Constants 7
Operators 8
Conditional statements 9
Unit II
Array 14
Function 17
Unit III
Session 222
Cookie 24
PHP fscanf() Function 26
parse_ini_file() function Definition and Usage 27
Getting file information with stat 27
Get information about a file using stat(): 28
Fseek 28
Copying files with copy 28
Reading and writing binary files 29
PHP Read Single Character - fgetc() 30
Locking files 30
Unit IV
MySQL Database 332
Databases 322
Database Queries 322
Unit V
Database connectivity 33
Processing result sets of queries 35
Handling errors 39
Debugging and diagnostic functions 40
Validating user input through Database layer and Application layer 40
Understanding Requirements 85
Designing the Database 86




Page 2 of

, STUDY MATERIAL FOR
IIIB.SC (CS)PHP & MYSQL



What is PHP? UNIT PHP
PHP is an recursive acronym for "PHP: Hypertext Preprocessor"
PHP is a widely-used, open source (free to download, use, modify and rerelease)
scripting language
PHP scripts are executed on the server. – server side scripting language

PHP History
⮚ PHP was developed by Rasmus Lerdorf for monitoring his online resume in 1995. It
slowly became popular. This first version PHP/F1 has some basic functions.
⮚ PHP/F1 2.0 was released and was quickly replaced by PHP 3.0 in 1997

⮚ PHP 3.0 was interesting. It was developed by and Andi Gutmans and Zeev suraski. It
includes support for wider range of data bases (Oracle and My SQL). This version had
greater portability. It was used by thousands of web servers.
⮚ PHP 4.0 was released in 2003. It used a new engine and provided better performance,
greater reliability and scalability and support for web servers other than Apache. It also
supports OOP features and built-in session management.
⮚ PHP 5.0 offers a complete object oriented program models. It also includes better
exception handling, a more consistent XML tool kit, improved My SQL support and a
better memory manager. PHP 5.0 was the best in the languages 10 year history. A
survey was conducted by net craft in April 2004. It showed that PHP was in use for over
15 million websites.

Features of PHP
PHP as a programming language for the web has many advantages than JSP, ASP and
VB.NET. Because of its simplicity and open source availability it is the widely used scripting
language for websites. The features of PHP that are listed below makes PHP the most
enjoyable language for the developer community.

Simplicity
Even a beginner can easily to learn PHP because it has
⮚ Clearly written manual

⮚ Consistent and logical syntax

⮚ It may take only two hours for a programmer to learn PHP and write scripts.

⮚ It has Kiss principle for (Keep it simple stupid) rapid application development.

⮚ It can also access c library and take advantage of that code.

Portability
The PHP scripts can be made to work on different platformsfrom PHP 3.0 This is
because PHP code is interpreted not compiled.The meaning of this portability is developer can
write code on windows and deploy on Unix with interpreter for PHP. PHP scripts can be run on
Microsoft windows, Unix, Mac OS and OS/2.

Page 3 of

, STUDY MATERIAL FOR
IIIB.SC (CS)PHP & MYSQL
Speed
PHP scripts run faster that most scripting languages like ASP, JSP and Perl. when PHP
was released it had new parsing engine which made it faster. PHP 5.0 was even faster through the
use of optimized memory manager and object handler.




Page 4 of

Written for

Institution
Course

Document information

Uploaded on
June 9, 2023
Number of pages
107
Written in
2022/2023
Type
Class notes
Professor(s)
Rajashekhar
Contains
All classes

Subjects

$10.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
kandechandu973

Get to know the seller

Seller avatar
kandechandu973 SK university
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions