SlideShare a Scribd company logo
1 of 17
NAME OF STAFF :S.SAYI PRIYA
NAME OF STUDENT :S.N.SWETHA
REGISTER NUMBER :CB17S 250445
CLASS :III-BCA-B
BATCH :2017-2020
YEAR :2020
SUBJECT CODE :MCA511
WEB TECHNOLOGIES
PHP FILES
OPENING FILES:
The PHP f open() function is used to open a file. It
requires two arguments stating first the file name and
then mode in which to operate.
Files modes can be specified as one of the six options in
this table.
S.NO MODE&PUURPOSE
1 r
Opens the file for reading only.
Places the file pointer at the beginning of the file.
2 r+
Opens the file for reading and writing.
Places the file pointer at the beginning of the file
3 W
Opens the file for writing only.
Places the file pointer at the beginning of the file
and truncates the file to zero length.
4 w+
Opens the file for reading and writing only.
Places the file pointer at the beginning of the file.
and truncates the file to zero length.
5 a
Opens the file for writing only.
Places the file pointer at the end of the file.
If files does not exist then it attempts to create a file.
6 a+
CLOSING FILES:
After making a changes to the opened file it is important to close it
with the f close() function. The f close() function requires a file
pointer as its argument and then returns true when the closure
succeeds or false if it fails.
READING A FILES:
Once a file is opened using f open() function it can be read
with a function called f read(). This function requires two
arguments. These must be the file pointer and the length of the
file expressed in bytes.
The files length can be found using the file size() function
which takes the file name as its argument and returns the size
of the file expressed in bytes.
So here are the steps required to read a file with PHP.
 Open a file using f open() function.
 Get the file's length using file size() function.
 Read the file's content using f read() function.
 Close the file with f close() function.
WRITING A FILE:
 A new file can be written or text can be appended to an existing file
using the PHP f write() function. This function requires two arguments
specifying a file pointer and the string of data that is to be written.
Optionally a third integer argument can be included to specify the
length of the data to write. If the third argument is included, writing
would will stop after the specified length has been reached.
MY SQL DATABASE
MY SQL DATABASE:
INSERT:
 To insert data into a My SQL table, you would need to use the
SQL INSERT INTO command. You can insert data into the My
SQL table by using the my sql > prompt or by using any script
like PHP.
Syntax:
INSERT INTO table name ( field1, field2,...field N )
VALUES
( value1, value2,...value N );
INSERTING DATA FROM THE COMMAND PROMPT:
To insert data from the command prompt, we will use SQL
INSERT INTO command to insert data into My SQL table
tutorial table.
My SQL prompt while pressing the enter key without giving a
semicolon at the end of each line of the command.
EXAMPLE:
 we have not provided a tutorial _ id because at the time of table
creation, we had given AUTO_INCREMENT option for this field. So
My SQL takes care of inserting these IDs automatically.
Here, NOW() is a My NSQL function, which returns the current date
and time.
UPDATE:
There may be a requirement where the existing data in a My SQL table
needs to be modified. You can do so by using the
SQL UPDATE command. This will modify any field value of any My
SQL table.
Syntax:
UPDATE table _ name SET field1 = new-value1,field2 = new-value2
[WHERE Clause]
DELETE:
 If you want to delete a record from any My SQL table, then you can
use the SQL command DELETE FROM. You can use this command
at the my sql > prompt as well as in any script like PHP.
Syntax:
DELETE FROM table _ name [WHERE Clause]
JOIN:
You can use JOINS in the SELECT, UPDATE and DELETE
statements to join the My SQL tables. We will see an example
of the LEFT JOIN also which is different from the simple My
SQL JOIN.
My SQL LEFT JOIN:
 A My SQL left join is different from a simple join. A My SQL LEFT
JOIN gives some extra consideration to the table that is on the left.
 If I do a LEFT JOIN, I get all the records that match in the same way
and IN ADDITION I get an extra record for each unmatched record in
the left table of the join: thus ensuring (in my example) that every
AUTHOR gets a mention.
GROUP BY:
 The SQL GROUP BY clause is used in collaboration with the
SELECT statement to arrange identical data into groups. This GROUP
BY clause follows the WHERE clause in a SELECT statement and
precedes the ORDER BY clause.
Syntax:
SELECT column1, column2
FROM table _ name
WHERE [ conditions ]
GROUP BY column1, column2
ORDER BY column1, column2
AGGREGATE FUNCTION:
Aggregate functions in DBMS take multiple rows from
the table and return a value according to the query.
All the aggregate functions are used in Select statement.
Syntax:
SELECT <FUNCTION NAME> (<PARAMETER>)
FROM <TABLE NAME>
AVG Function:
 This function returns the average value of the numeric
column that is supplied as a parameter.
Example: Write a query to select average salary from
employee table.
Select AVG(salary) from Employee
COUNT Function:
The count function returns the number of rows in the
result. It does not count the null values.
Example: Write a query to return number of rows where salary >
20000.
Select COUNT(*) from Employee where Salary > 20000;
Types:
COUNT(*): Counts all the number of rows of the table including
null.
COUNT( COLUMN_NAME): count number of non-null values in
column.
COUNT( DISTINCT COLUMN_NAME): count number of distinct
values in a column.
MAX Function:
The MAX function is used to find maximum value in the column
that is supplied as a parameter. It can be used on any type of data.
Example: Write a query to find the maximum salary in employee
table.
Select MAX(salary) from Employee
SUM Function:
This function sums up the values in the column supplied as a
parameter.
Example: Write a query to get the total salary of employees.
 Select SUM(salary) from Employee
STDDEV Function:
The STDDEV function is used to find standard deviation of the
column specified as argument.
Example: Write a query to find standard deviation of salary in
Employee table.
 Select STDDEV(salary) from Employee
VARIANCE Function:
The VARIANCE Function is used to find variance of the column
specified as argument.
Example:
 Select VARIANCE(salary) from Employee
FORMAT:
 Here Format Name represents the name of the format. The field
line is the specific way, the data should be formatted. The values lines
represent the values that will be entered into the field line. You end the
format with a single period.
Syntax:
Format Name = Field line;
Value _ one, value _ two, value _ three
Field line
Value _ one, value _ two.
USING THE FORMAT:
 In order to invoke this format declaration, we would use
the write keyword −
 write EMPLOYEE;
 The problem is that the format name is usually the name of an open
file handle, and the write statement will send the output to this file
handle. As we want the data sent to the STDOUT, we must associate
EMPLOYEE with the STDOUT filehandle. First, however, we must
make sure that that STDOUT is our selected file handle, using the
select() function.
 select(STDOUT);
 We would then associate EMPLOYEE with STDOUT by setting the
new format name with STDOUT, using the special variable $~ or
$FORMAT_NAME as follows −
 $~ = "EMPLOYEE";
CASE STUDIES:
My SQL Enterprise:
 Z-appos Uses My SQL to Power its Growth & Exceptional Customer Service
 Booking.com Serves One Million Visitors per Day with My SQL Enterprise
Unlimited
 Click ability Dramatically Improves Performance and Scalability with My SQL
Query Analyzer
My SQL Embedded Server:
 My SQL Helps Simply Accounting by Sage Increase Revenue, Market Share, and
Customer Satisfaction
 Con-ceiviums Relies on My SQL to Perform Real-Time Analytics for BlackBerry
Enterprise Server
 Adobe Relies on My SQL to Make Creative Professionals More Productive
My SQL Cluster:
 My SQL Cluster Powers Leading Mobile Media Publishing Platform
 Cash point Saves Half a Million Euros per Year as it Bets on My SQL
 Shopatrons uses My SQL Cluster to Power its Rapidly Growing e-Commerce
Service
 Plus net Achieves Continuous Availability of AAA Services with My SQL Cluster
 Alcatel-Lucent uses My SQL Cluster Carrier Grade Edition to Handle over 60
million Subscribers
THANK YOU

More Related Content

What's hot (19)

NOTES ON "FOXPRO"
NOTES ON "FOXPRO" NOTES ON "FOXPRO"
NOTES ON "FOXPRO"
 
Sql Queries
Sql QueriesSql Queries
Sql Queries
 
SQL Functions and Operators
SQL Functions and OperatorsSQL Functions and Operators
SQL Functions and Operators
 
Prabu's sql quries
Prabu's sql quries Prabu's sql quries
Prabu's sql quries
 
My sql Syntax
My sql SyntaxMy sql Syntax
My sql Syntax
 
Proc sql tips
Proc sql tipsProc sql tips
Proc sql tips
 
Lab1 select statement
Lab1 select statementLab1 select statement
Lab1 select statement
 
Lecture02 abap on line
Lecture02 abap on lineLecture02 abap on line
Lecture02 abap on line
 
Sql
SqlSql
Sql
 
Mysql1
Mysql1Mysql1
Mysql1
 
MYSQL
MYSQLMYSQL
MYSQL
 
005 foxpro
005 foxpro005 foxpro
005 foxpro
 
Cis407 a ilab 4 web application development devry university
Cis407 a ilab 4 web application development devry universityCis407 a ilab 4 web application development devry university
Cis407 a ilab 4 web application development devry university
 
SQL
SQLSQL
SQL
 
Latex Tuitorial
Latex TuitorialLatex Tuitorial
Latex Tuitorial
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
 
SAS Macros part 1
SAS Macros part 1SAS Macros part 1
SAS Macros part 1
 
Correlated update vs merge
Correlated update vs mergeCorrelated update vs merge
Correlated update vs merge
 
SQL Programming
SQL ProgrammingSQL Programming
SQL Programming
 

Similar to Unit 2 web technologies

My sql with querys
My sql with querysMy sql with querys
My sql with querysNIRMAL FELIX
 
Oracle_Analytical_function.pdf
Oracle_Analytical_function.pdfOracle_Analytical_function.pdf
Oracle_Analytical_function.pdfKalyankumarVenkat1
 
Presentation on c structures
Presentation on c   structures Presentation on c   structures
Presentation on c structures topu93
 
Presentation on c programing satcture
Presentation on c programing satcture Presentation on c programing satcture
Presentation on c programing satcture topu93
 
Stop hardcoding follow parameterization
Stop hardcoding  follow parameterizationStop hardcoding  follow parameterization
Stop hardcoding follow parameterizationPreeti Sagar
 
Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007paulguerin
 
11i&r12 difference
11i&r12 difference11i&r12 difference
11i&r12 differencevenki_venki
 
Unit iii vb_study_materials
Unit iii vb_study_materialsUnit iii vb_study_materials
Unit iii vb_study_materialsgayaramesh
 
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docxAssg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docxfestockton
 
Abstract Data Types (a) Explain briefly what is meant by the ter.pdf
Abstract Data Types (a) Explain briefly what is meant by the ter.pdfAbstract Data Types (a) Explain briefly what is meant by the ter.pdf
Abstract Data Types (a) Explain briefly what is meant by the ter.pdfkarymadelaneyrenne19
 
Data Manipulation Language.pptx
Data Manipulation Language.pptxData Manipulation Language.pptx
Data Manipulation Language.pptxEllenGracePorras
 
Database development coding standards
Database development coding standardsDatabase development coding standards
Database development coding standardsAlessandro Baratella
 

Similar to Unit 2 web technologies (20)

Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
Chapter9 more on database and sql
Chapter9 more on database and sqlChapter9 more on database and sql
Chapter9 more on database and sql
 
My sql.ppt
My sql.pptMy sql.ppt
My sql.ppt
 
My sql with querys
My sql with querysMy sql with querys
My sql with querys
 
Php
PhpPhp
Php
 
Oracle_Analytical_function.pdf
Oracle_Analytical_function.pdfOracle_Analytical_function.pdf
Oracle_Analytical_function.pdf
 
Presentation on c structures
Presentation on c   structures Presentation on c   structures
Presentation on c structures
 
Presentation on c programing satcture
Presentation on c programing satcture Presentation on c programing satcture
Presentation on c programing satcture
 
Stop hardcoding follow parameterization
Stop hardcoding  follow parameterizationStop hardcoding  follow parameterization
Stop hardcoding follow parameterization
 
Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007
 
11i&r12 difference
11i&r12 difference11i&r12 difference
11i&r12 difference
 
Unit iii vb_study_materials
Unit iii vb_study_materialsUnit iii vb_study_materials
Unit iii vb_study_materials
 
MA3696 Lecture 9
MA3696 Lecture 9MA3696 Lecture 9
MA3696 Lecture 9
 
Sq lite
Sq liteSq lite
Sq lite
 
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docxAssg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
 
Abstract Data Types (a) Explain briefly what is meant by the ter.pdf
Abstract Data Types (a) Explain briefly what is meant by the ter.pdfAbstract Data Types (a) Explain briefly what is meant by the ter.pdf
Abstract Data Types (a) Explain briefly what is meant by the ter.pdf
 
ADVANCED MODELLING.pptx
ADVANCED MODELLING.pptxADVANCED MODELLING.pptx
ADVANCED MODELLING.pptx
 
PHP - Introduction to PHP Date and Time Functions
PHP -  Introduction to  PHP Date and Time FunctionsPHP -  Introduction to  PHP Date and Time Functions
PHP - Introduction to PHP Date and Time Functions
 
Data Manipulation Language.pptx
Data Manipulation Language.pptxData Manipulation Language.pptx
Data Manipulation Language.pptx
 
Database development coding standards
Database development coding standardsDatabase development coding standards
Database development coding standards
 

Recently uploaded

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 

Recently uploaded (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 

Unit 2 web technologies

  • 1. NAME OF STAFF :S.SAYI PRIYA NAME OF STUDENT :S.N.SWETHA REGISTER NUMBER :CB17S 250445 CLASS :III-BCA-B BATCH :2017-2020 YEAR :2020 SUBJECT CODE :MCA511 WEB TECHNOLOGIES
  • 2. PHP FILES OPENING FILES: The PHP f open() function is used to open a file. It requires two arguments stating first the file name and then mode in which to operate. Files modes can be specified as one of the six options in this table.
  • 3. S.NO MODE&PUURPOSE 1 r Opens the file for reading only. Places the file pointer at the beginning of the file. 2 r+ Opens the file for reading and writing. Places the file pointer at the beginning of the file 3 W Opens the file for writing only. Places the file pointer at the beginning of the file and truncates the file to zero length. 4 w+ Opens the file for reading and writing only. Places the file pointer at the beginning of the file. and truncates the file to zero length. 5 a Opens the file for writing only. Places the file pointer at the end of the file. If files does not exist then it attempts to create a file. 6 a+
  • 4. CLOSING FILES: After making a changes to the opened file it is important to close it with the f close() function. The f close() function requires a file pointer as its argument and then returns true when the closure succeeds or false if it fails. READING A FILES: Once a file is opened using f open() function it can be read with a function called f read(). This function requires two arguments. These must be the file pointer and the length of the file expressed in bytes. The files length can be found using the file size() function which takes the file name as its argument and returns the size of the file expressed in bytes.
  • 5. So here are the steps required to read a file with PHP.  Open a file using f open() function.  Get the file's length using file size() function.  Read the file's content using f read() function.  Close the file with f close() function. WRITING A FILE:  A new file can be written or text can be appended to an existing file using the PHP f write() function. This function requires two arguments specifying a file pointer and the string of data that is to be written. Optionally a third integer argument can be included to specify the length of the data to write. If the third argument is included, writing would will stop after the specified length has been reached.
  • 6. MY SQL DATABASE MY SQL DATABASE: INSERT:  To insert data into a My SQL table, you would need to use the SQL INSERT INTO command. You can insert data into the My SQL table by using the my sql > prompt or by using any script like PHP.
  • 7. Syntax: INSERT INTO table name ( field1, field2,...field N ) VALUES ( value1, value2,...value N ); INSERTING DATA FROM THE COMMAND PROMPT: To insert data from the command prompt, we will use SQL INSERT INTO command to insert data into My SQL table tutorial table. My SQL prompt while pressing the enter key without giving a semicolon at the end of each line of the command. EXAMPLE:  we have not provided a tutorial _ id because at the time of table creation, we had given AUTO_INCREMENT option for this field. So My SQL takes care of inserting these IDs automatically. Here, NOW() is a My NSQL function, which returns the current date and time.
  • 8. UPDATE: There may be a requirement where the existing data in a My SQL table needs to be modified. You can do so by using the SQL UPDATE command. This will modify any field value of any My SQL table. Syntax: UPDATE table _ name SET field1 = new-value1,field2 = new-value2 [WHERE Clause] DELETE:  If you want to delete a record from any My SQL table, then you can use the SQL command DELETE FROM. You can use this command at the my sql > prompt as well as in any script like PHP.
  • 9. Syntax: DELETE FROM table _ name [WHERE Clause] JOIN: You can use JOINS in the SELECT, UPDATE and DELETE statements to join the My SQL tables. We will see an example of the LEFT JOIN also which is different from the simple My SQL JOIN. My SQL LEFT JOIN:  A My SQL left join is different from a simple join. A My SQL LEFT JOIN gives some extra consideration to the table that is on the left.  If I do a LEFT JOIN, I get all the records that match in the same way and IN ADDITION I get an extra record for each unmatched record in the left table of the join: thus ensuring (in my example) that every AUTHOR gets a mention.
  • 10. GROUP BY:  The SQL GROUP BY clause is used in collaboration with the SELECT statement to arrange identical data into groups. This GROUP BY clause follows the WHERE clause in a SELECT statement and precedes the ORDER BY clause. Syntax: SELECT column1, column2 FROM table _ name WHERE [ conditions ] GROUP BY column1, column2 ORDER BY column1, column2
  • 11. AGGREGATE FUNCTION: Aggregate functions in DBMS take multiple rows from the table and return a value according to the query. All the aggregate functions are used in Select statement. Syntax: SELECT <FUNCTION NAME> (<PARAMETER>) FROM <TABLE NAME> AVG Function:  This function returns the average value of the numeric column that is supplied as a parameter. Example: Write a query to select average salary from employee table. Select AVG(salary) from Employee COUNT Function: The count function returns the number of rows in the result. It does not count the null values.
  • 12. Example: Write a query to return number of rows where salary > 20000. Select COUNT(*) from Employee where Salary > 20000; Types: COUNT(*): Counts all the number of rows of the table including null. COUNT( COLUMN_NAME): count number of non-null values in column. COUNT( DISTINCT COLUMN_NAME): count number of distinct values in a column. MAX Function: The MAX function is used to find maximum value in the column that is supplied as a parameter. It can be used on any type of data. Example: Write a query to find the maximum salary in employee table. Select MAX(salary) from Employee
  • 13. SUM Function: This function sums up the values in the column supplied as a parameter. Example: Write a query to get the total salary of employees.  Select SUM(salary) from Employee STDDEV Function: The STDDEV function is used to find standard deviation of the column specified as argument. Example: Write a query to find standard deviation of salary in Employee table.  Select STDDEV(salary) from Employee VARIANCE Function: The VARIANCE Function is used to find variance of the column specified as argument. Example:  Select VARIANCE(salary) from Employee
  • 14. FORMAT:  Here Format Name represents the name of the format. The field line is the specific way, the data should be formatted. The values lines represent the values that will be entered into the field line. You end the format with a single period. Syntax: Format Name = Field line; Value _ one, value _ two, value _ three Field line Value _ one, value _ two. USING THE FORMAT:  In order to invoke this format declaration, we would use the write keyword −  write EMPLOYEE;
  • 15.  The problem is that the format name is usually the name of an open file handle, and the write statement will send the output to this file handle. As we want the data sent to the STDOUT, we must associate EMPLOYEE with the STDOUT filehandle. First, however, we must make sure that that STDOUT is our selected file handle, using the select() function.  select(STDOUT);  We would then associate EMPLOYEE with STDOUT by setting the new format name with STDOUT, using the special variable $~ or $FORMAT_NAME as follows −  $~ = "EMPLOYEE";
  • 16. CASE STUDIES: My SQL Enterprise:  Z-appos Uses My SQL to Power its Growth & Exceptional Customer Service  Booking.com Serves One Million Visitors per Day with My SQL Enterprise Unlimited  Click ability Dramatically Improves Performance and Scalability with My SQL Query Analyzer My SQL Embedded Server:  My SQL Helps Simply Accounting by Sage Increase Revenue, Market Share, and Customer Satisfaction  Con-ceiviums Relies on My SQL to Perform Real-Time Analytics for BlackBerry Enterprise Server  Adobe Relies on My SQL to Make Creative Professionals More Productive My SQL Cluster:  My SQL Cluster Powers Leading Mobile Media Publishing Platform  Cash point Saves Half a Million Euros per Year as it Bets on My SQL  Shopatrons uses My SQL Cluster to Power its Rapidly Growing e-Commerce Service  Plus net Achieves Continuous Availability of AAA Services with My SQL Cluster  Alcatel-Lucent uses My SQL Cluster Carrier Grade Edition to Handle over 60 million Subscribers