Gartner Most Frequently Asked PHP Latest Interview Questions Answers
How Can Increase The Performance Of Mysql Select Query?
We can use LIMIT to stop MySql for further search in table after we have received our required no. of records, also we can use LEFT JOIN or RIGHT JOIN instead of full join in cases we have related data in two or more tables.
Will Comparison Of String "10" And Integer 11 Work In Php?
Yes, internally PHP will cast everything to the integer type, so numbers 10 and 11 will be compared.
What Type Of Inheritance That Php Supports?
In PHP an extended class is always dependent on a single base class, that is, multiple inheritance is not supported. Classes are extended using the keyword 'extends'.
What Is The Functionality Of Md5 Function In Php?
string md5(string)
It calculates the MD5 hash of a string. The hash is a 32-character hexadecimal number.
How Can I Load Data From A Text File Into A Table?
The MySQL provides a LOAD DATA INFILE command. You can load data from a file.
Great tool but you need to make sure that:
a) Data must be delimited.
b) Data fields must match table columns correctly.
How Can We Know The Number Of Days Between Two Given Dates Using Mysql?
Use DATEDIFF()
SELECT DATEDIFF(NOW(),'2006-07-01');
How Can We Change The Data Type Of A Column Of A Table?
This will change the data type of a column:
ALTER TABLE table_name CHANGE colm_name same_colm_name [new data type].
How Can We Know That A Session Is Started Or Not?
A session starts by session_start() function.
This session_start() is always declared in header portion. it always declares first. then we write session_ register().
How Many Ways We Can Give The Output To A Browser?
HTML output
PHP, ASP, JSP, Servlet Function
Script Language output Function
Different Type of embedded Package to output to a browser.
Please Give A Regular Expression (preferably Perl/preg Style), Which Can Be Used To Identify The Url From Within A Html Link Tag?
Try this: /href="([^"]*)"/i.
Give The Syntax Of Grant Commands?
The generic syntax for GRANT is as following
GRANT [rights] on [database] TO [username@hostname] IDENTIFIED BY [password]
Now rights can be:
a) ALL privilages
b) Combination of CREATE, DROP, SELECT, INSERT, UPDATE and DELETE etc.
We can grant rights on all databse by usingh *.* or some specific database by database.* or a specific table by database.table_name.
What Are The Different Ways To Login To A Remote Server? Explain The Means, Advantages And Disadvantages?
There is at least 3 ways to logon to a remote server:
Use ssh or telnet if you concern with security
You can also use rlogin to logon to a remote server.
Give The Syntax Of Revoke Commands?
The generic syntax for revoke is as following
REVOKE [rights] on [database] FROM [username@hostname]
Now rights can be:
a) ALL privilages
b) Combination of CREATE, DROP, SELECT, INSERT, UPDATE and DELETE etc.
We can grant rights on all databse by usingh *.* or some specific database by database.* or a specific table by database.table_name.
When Viewing An Html Page In A Browser, The Browser Often Keeps This Page In Its Cache. What Can Be Possible Advantages/disadvantages Of Page Caching? How Can You Prevent Caching Of A Certain Page (please Give Several Alternate Solutions)?
When you use the metatag in the header section at the beginning of an HTML Web page, the Web page may still be cached in the Temporary Internet Files folder.
A page that Internet Explorer is browsing is not cached until half of the 64 KB buffer is filled. Usually, metatags are inserted in the header section of an HTML document, which appears at the beginning of the document. When the HTML code is parsed, it is read from top to bottom. When the metatag is read, Internet Explorer looks for the existence of the page in cache at that exact moment. If it is there, it is removed. To properly prevent the Web page from appearing in the cache, place another header section at the end of the HTML document.
What Are The Advantages And Disadvantages Of Cascade Style Sheets?
External Style Sheets
Advantages
Can control styles for multiple documents at once Classes can be created for use on multiple HTML element types in many documents Selector and grouping methods can be used to apply styles under complex contexts
Disadvantages
An extra download is required to import style information for each document The rendering of the document may be delayed until the external style sheet is loaded Becomes slightly unwieldy for small quantities of style definitions
Embedded Style Sheets
Advantages
Classes can be created for use on multiple tag types in the document Selector and grouping methods can be used to apply styles under complex contexts No additional downloads necessary to receive style information
Disadvantage
This method can not control styles for multiple documents at once
Inline Styles
Advantages
Useful for small quantities of style definitions Can override other style specification methods at the local level so only exceptions need to be listed in conjunction with other style methods
Disadvantages
Does not distance style information from content (a main goal of SGML/HTML) Can not control styles for multiple documents at once Author can not create or control classes of elements to control multiple element types within the document Selector grouping methods can not be used to create complex element addressing scenarios.
How Can Increase The Performance Of Mysql Select Query?
We can use LIMIT to stop MySql for further search in table after we have received our required no. of records, also we can use LEFT JOIN or RIGHT JOIN instead of full join in cases we have related data in two or more tables.
Will Comparison Of String "10" And Integer 11 Work In Php?
Yes, internally PHP will cast everything to the integer type, so numbers 10 and 11 will be compared.
What Type Of Inheritance That Php Supports?
In PHP an extended class is always dependent on a single base class, that is, multiple inheritance is not supported. Classes are extended using the keyword 'extends'.
What Is The Functionality Of Md5 Function In Php?
string md5(string)
It calculates the MD5 hash of a string. The hash is a 32-character hexadecimal number.
How Can I Load Data From A Text File Into A Table?
The MySQL provides a LOAD DATA INFILE command. You can load data from a file.
Great tool but you need to make sure that:
a) Data must be delimited.
b) Data fields must match table columns correctly.
Gartner Most Frequently Asked PHP Latest Interview Questions Answers |
How Can We Know The Number Of Days Between Two Given Dates Using Mysql?
Use DATEDIFF()
SELECT DATEDIFF(NOW(),'2006-07-01');
How Can We Change The Data Type Of A Column Of A Table?
This will change the data type of a column:
ALTER TABLE table_name CHANGE colm_name same_colm_name [new data type].
How Can We Know That A Session Is Started Or Not?
A session starts by session_start() function.
This session_start() is always declared in header portion. it always declares first. then we write session_ register().
How Many Ways We Can Give The Output To A Browser?
HTML output
PHP, ASP, JSP, Servlet Function
Script Language output Function
Different Type of embedded Package to output to a browser.
Please Give A Regular Expression (preferably Perl/preg Style), Which Can Be Used To Identify The Url From Within A Html Link Tag?
Try this: /href="([^"]*)"/i.
Give The Syntax Of Grant Commands?
The generic syntax for GRANT is as following
GRANT [rights] on [database] TO [username@hostname] IDENTIFIED BY [password]
Now rights can be:
a) ALL privilages
b) Combination of CREATE, DROP, SELECT, INSERT, UPDATE and DELETE etc.
We can grant rights on all databse by usingh *.* or some specific database by database.* or a specific table by database.table_name.
What Are The Different Ways To Login To A Remote Server? Explain The Means, Advantages And Disadvantages?
There is at least 3 ways to logon to a remote server:
Use ssh or telnet if you concern with security
You can also use rlogin to logon to a remote server.
Give The Syntax Of Revoke Commands?
The generic syntax for revoke is as following
REVOKE [rights] on [database] FROM [username@hostname]
Now rights can be:
a) ALL privilages
b) Combination of CREATE, DROP, SELECT, INSERT, UPDATE and DELETE etc.
We can grant rights on all databse by usingh *.* or some specific database by database.* or a specific table by database.table_name.
When Viewing An Html Page In A Browser, The Browser Often Keeps This Page In Its Cache. What Can Be Possible Advantages/disadvantages Of Page Caching? How Can You Prevent Caching Of A Certain Page (please Give Several Alternate Solutions)?
When you use the metatag in the header section at the beginning of an HTML Web page, the Web page may still be cached in the Temporary Internet Files folder.
A page that Internet Explorer is browsing is not cached until half of the 64 KB buffer is filled. Usually, metatags are inserted in the header section of an HTML document, which appears at the beginning of the document. When the HTML code is parsed, it is read from top to bottom. When the metatag is read, Internet Explorer looks for the existence of the page in cache at that exact moment. If it is there, it is removed. To properly prevent the Web page from appearing in the cache, place another header section at the end of the HTML document.
What Are The Advantages And Disadvantages Of Cascade Style Sheets?
External Style Sheets
Advantages
Can control styles for multiple documents at once Classes can be created for use on multiple HTML element types in many documents Selector and grouping methods can be used to apply styles under complex contexts
Disadvantages
An extra download is required to import style information for each document The rendering of the document may be delayed until the external style sheet is loaded Becomes slightly unwieldy for small quantities of style definitions
Embedded Style Sheets
Advantages
Classes can be created for use on multiple tag types in the document Selector and grouping methods can be used to apply styles under complex contexts No additional downloads necessary to receive style information
Disadvantage
This method can not control styles for multiple documents at once
Inline Styles
Advantages
Useful for small quantities of style definitions Can override other style specification methods at the local level so only exceptions need to be listed in conjunction with other style methods
Disadvantages
Does not distance style information from content (a main goal of SGML/HTML) Can not control styles for multiple documents at once Author can not create or control classes of elements to control multiple element types within the document Selector grouping methods can not be used to create complex element addressing scenarios.
Post a Comment