SlideShare a Scribd company logo
PHP FILES
SUBMITTED BY:
S.N.SWETHA
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

Commands
CommandsCommands
Commands
Ayushi Goyal
 
Mysqlppt
MysqlpptMysqlppt
MysqlpptReka
 
My sql Syntax
My sql SyntaxMy sql Syntax
My sql SyntaxReka
 
Prabu's sql quries
Prabu's sql quries Prabu's sql quries
Prabu's sql quries Prabu Cse
 
Data Definition Language (DDL)
Data Definition Language (DDL) Data Definition Language (DDL)
Data Definition Language (DDL)
Mohd Tousif
 
Import and Export Excel files using XLConnect in R Studio
Import and Export Excel files using XLConnect in R StudioImport and Export Excel files using XLConnect in R Studio
Import and Export Excel files using XLConnect in R Studio
Rupak Roy
 
Oracle naveen Sql
Oracle naveen   SqlOracle naveen   Sql
Oracle naveen Sql
naveen
 
Interacting with Oracle Database
Interacting with Oracle DatabaseInteracting with Oracle Database
Interacting with Oracle Database
Chhom Karath
 
Import and Export Excel Data using openxlsx in R Studio
Import and Export Excel Data using openxlsx in R StudioImport and Export Excel Data using openxlsx in R Studio
Import and Export Excel Data using openxlsx in R Studio
Rupak Roy
 
Oracle: DDL
Oracle: DDLOracle: DDL
Oracle: DDL
DataminingTools Inc
 
235689260 oracle-forms-10g-tutorial
235689260 oracle-forms-10g-tutorial235689260 oracle-forms-10g-tutorial
235689260 oracle-forms-10g-tutorial
homeworkping3
 
Php
PhpPhp
SQL
SQLSQL

What's hot (19)

Commands
CommandsCommands
Commands
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
My sql Syntax
My sql SyntaxMy sql Syntax
My sql Syntax
 
Prabu's sql quries
Prabu's sql quries Prabu's sql quries
Prabu's sql quries
 
Data Definition Language (DDL)
Data Definition Language (DDL) Data Definition Language (DDL)
Data Definition Language (DDL)
 
Import and Export Excel files using XLConnect in R Studio
Import and Export Excel files using XLConnect in R StudioImport and Export Excel files using XLConnect in R Studio
Import and Export Excel files using XLConnect in R Studio
 
Oracle naveen Sql
Oracle naveen   SqlOracle naveen   Sql
Oracle naveen Sql
 
Interacting with Oracle Database
Interacting with Oracle DatabaseInteracting with Oracle Database
Interacting with Oracle Database
 
Import and Export Excel Data using openxlsx in R Studio
Import and Export Excel Data using openxlsx in R StudioImport and Export Excel Data using openxlsx in R Studio
Import and Export Excel Data using openxlsx in R Studio
 
Sql
SqlSql
Sql
 
Oracle: DDL
Oracle: DDLOracle: DDL
Oracle: DDL
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
235689260 oracle-forms-10g-tutorial
235689260 oracle-forms-10g-tutorial235689260 oracle-forms-10g-tutorial
235689260 oracle-forms-10g-tutorial
 
Proc sql tips
Proc sql tipsProc sql tips
Proc sql tips
 
Linker scripts
Linker scriptsLinker scripts
Linker scripts
 
SQL
SQLSQL
SQL
 
Php
PhpPhp
Php
 
Mysql1
Mysql1Mysql1
Mysql1
 
SQL
SQLSQL
SQL
 

Similar to WEB TECHNOLOGIES Unit 2

My sql with querys
My sql with querysMy sql with querys
My sql with querysNIRMAL FELIX
 
11i&r12 difference
11i&r12 difference11i&r12 difference
11i&r12 difference
venki_venki
 
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
festockton
 
Dynamic websites lec3
Dynamic websites lec3Dynamic websites lec3
Dynamic websites lec3
Belal Arfa
 
Sql loader good example
Sql loader good exampleSql loader good example
Sql loader good example
Aneel Swarna MBA ,PMP
 
Your 1ab8 c file is doe by Friday 1159pm to be submitted.pdf
Your 1ab8 c file is doe by Friday 1159pm to be submitted.pdfYour 1ab8 c file is doe by Friday 1159pm to be submitted.pdf
Your 1ab8 c file is doe by Friday 1159pm to be submitted.pdf
abhijitmaskey
 
Programming Assignment Help
Programming Assignment HelpProgramming Assignment Help
Programming Assignment Help
Programming Homework Help
 
Presentation on c programing satcture
Presentation on c programing satcture Presentation on c programing satcture
Presentation on c programing satcture
topu93
 
Presentation on c structures
Presentation on c   structures Presentation on c   structures
Presentation on c structures
topu93
 
Matlab Manual
Matlab ManualMatlab Manual
Python_Unit-1_PPT_Data Types.pptx
Python_Unit-1_PPT_Data Types.pptxPython_Unit-1_PPT_Data Types.pptx
Python_Unit-1_PPT_Data Types.pptx
SahajShrimal1
 
Sql server ___________session 3(sql 2008)
Sql server  ___________session 3(sql 2008)Sql server  ___________session 3(sql 2008)
Sql server ___________session 3(sql 2008)
Ehtisham Ali
 
Introduction to MySQL - Part 2
Introduction to MySQL - Part 2Introduction to MySQL - Part 2
Introduction to MySQL - Part 2webhostingguy
 

Similar to WEB TECHNOLOGIES Unit 2 (20)

My sql.ppt
My sql.pptMy sql.ppt
My sql.ppt
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
My sql with querys
My sql with querysMy sql with querys
My sql with querys
 
11i&r12 difference
11i&r12 difference11i&r12 difference
11i&r12 difference
 
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
 
MA3696 Lecture 9
MA3696 Lecture 9MA3696 Lecture 9
MA3696 Lecture 9
 
Dynamic websites lec3
Dynamic websites lec3Dynamic websites lec3
Dynamic websites lec3
 
Savitch ch 04
Savitch ch 04Savitch ch 04
Savitch ch 04
 
Mysql
MysqlMysql
Mysql
 
Mysql
MysqlMysql
Mysql
 
Mysql
MysqlMysql
Mysql
 
Sql loader good example
Sql loader good exampleSql loader good example
Sql loader good example
 
Your 1ab8 c file is doe by Friday 1159pm to be submitted.pdf
Your 1ab8 c file is doe by Friday 1159pm to be submitted.pdfYour 1ab8 c file is doe by Friday 1159pm to be submitted.pdf
Your 1ab8 c file is doe by Friday 1159pm to be submitted.pdf
 
Programming Assignment Help
Programming Assignment HelpProgramming Assignment Help
Programming Assignment Help
 
Presentation on c programing satcture
Presentation on c programing satcture Presentation on c programing satcture
Presentation on c programing satcture
 
Presentation on c structures
Presentation on c   structures Presentation on c   structures
Presentation on c structures
 
Matlab Manual
Matlab ManualMatlab Manual
Matlab Manual
 
Python_Unit-1_PPT_Data Types.pptx
Python_Unit-1_PPT_Data Types.pptxPython_Unit-1_PPT_Data Types.pptx
Python_Unit-1_PPT_Data Types.pptx
 
Sql server ___________session 3(sql 2008)
Sql server  ___________session 3(sql 2008)Sql server  ___________session 3(sql 2008)
Sql server ___________session 3(sql 2008)
 
Introduction to MySQL - Part 2
Introduction to MySQL - Part 2Introduction to MySQL - Part 2
Introduction to MySQL - Part 2
 

Recently uploaded

Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
ViralQR
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 

Recently uploaded (20)

Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 

WEB TECHNOLOGIES Unit 2

  • 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