Saturday, November 28, 2015

Php Descriptive



1. What are the functions used for file upload?
Ans. PHP offers two functions specifically intended to aid in the file upload process, they are is_uploaded_file() and move_uploaded_file().

2. What is DNS?
Ans. The Domain Name System (DNS) is what allows us to use domain names (e.g., example.com) in place
of the corresponding IP address, such as 192.0.34.166. The domain names and their complementary IP
addresses are stored on domain name servers, which are interspersed across the globe.

3. Mention five Internet services?
Ans. Internet services are: HTTP, FTP, POP3, IMAP, and SSH.

4. Explain the parameters of PHP’s mail function.
Ans. Parameters of PHP’s mail function:
               to: Receiver, or receivers of the mail. As: user@example.com
               subject: Subject of the email to be sent.
               message: Message to be sent.  Each line should be separated with a LF (\n). Lines should not be larger than 70 characters.
               additional_headers (optional): String to be inserted at the end of the email header. This is typically used to add extra headers (From, Cc, and Bcc). Multiple extra headers should be separated with a CRLF (\r\n).
               additional_parameters (optional): The additional_parameters parameter can be used to pass additional flags as command line options to the program configured to be used when sending mail, as defined by the sendmail_path configuration setting.

5. Why HTTP is called stateless protocol?
Ans. The Hypertext Transfer Protocol (HTTP) defines the rules used to transfer text, graphics, video, and all other data via the World Wide Web. It is a stateless protocol, meaning that each request is processed without any knowledge of any prior or future requests.

6. How many ways session handling can be done?
Ans. Session handling can be done in two ways. 1. Cookies & 2. URL rewriting.

7. What are web services?
Ans. Web Services are typically application programming interfaces (APIs) or web APIs that are accessed via Hypertext Transfer Protocol (HTTP) and executed on a remote system hosting the requested services.

8. What are the benefits of using web services?
Ans. The benefits of using web services are:
1.      The ability to treat software as a service.
2.      Significantly improved Enterprise Application Integration (EAI) processes.
3.      Global reusability.
4.      Ubiquitous accessibility.

9. What is RSS feed?
Ans. RSS offers a formalized means for encapsulating a web site’s content within an XML-based structure, known as a feed. It’s based on the premise that most site information shares a similar format, regardless of topic.

10. What is data encryption?
Ans. Encryption can be defined as the translation of data into a format that is intended to be unreadable by anyone except the intended party. The intended party can then decode, or decrypt, the encrypted data through the use of some secret—typically a secret key or password.

11. What is query caching?
Ans. Query caching is one of MySQL’s greatest speed enhancements. Simple and highly effective when enabled, query caching allows MySQL to store SELECT queries, along with their corresponding results, in memory. As subsequent queries are executed, MySQL compares them against the cached queries; if they match, MySQL forgoes the costly database retrieval and instead dumps the cached query result.

12. What is storage engines?
Ans. A “storage engine” is a handler that manages a certain kind of table.

13. What are the advantages of Innodb table?
Ans. Advantages of Innodb table are:
• Update-intensive tables: The InnoDB storage engine is particularly adept at handling multiple simultaneous update requests.
• Transactions: The InnoDB storage engine is the only standard MySQL storage engine that supports transactions, a requisite feature for managing sensitive data such as financial or user registration information.
• Automated crash recovery: Unlike other storage engines, InnoDB tables are capable of automatically recovering from a crash. Although MyISAM tables can also be repaired after a crash, the process can take significantly longer.

14. What are the difference between primary key and unique?
Ans. Primary key: The PRIMARY KEY attribute is used to guarantee uniqueness for a given row. No values residing in a column designated as a primary key are repeatable or nullable within that column.
Unique: A column assigned the UNIQUE attribute will ensure that all values possess distinct values, except that NULL values are repeatable.

15. What are the purposes of GRANT and REVOKE commands?
Ans. The GRANT and REVOKE commands are used to manage access privileges. The GRANT and REVOKE commands offer a great deal of granular control over who can work with practically every conceivable aspect of the server and its contents, from who can shut down the server to who can modify information residing within a particular table column.

16. What is the benefit of using prepare statement?
Ans. Prepared statements eliminate overhead and inconvenience when working with queries intended for repeated execution, as is so often the case when building database-driven web sites. Prepared statements
also offer another important security-related feature in that they prevent SQL injection attacks.

17. What are the advantages of stored routine?
Ans. Stored routines have a number of advantages, the most prominent of which are highlighted here:
1. Consistency 2. Performance 3. Security 4. Architecture

18. What are the benefits of using triggers?
Ans. The benefits of using triggers are:
  1. Preventing corruption due to malformed data.
  2. Enforcing business rules, such as ensuring that an attempt to insert information about a product into the product table includes the identifier of a manufacturer whose information already resides in the manufacturer table.
  3. Ensuring database integrity by cascading changes throughout a database, such as removing all products associated with a manufacturer that you’d like to remove from the system.

19. What are the advantages of using view?
Ans. The advantages of using view are:
1. Simplicity 2. Security 3. Maintainability

20. What is cursor? Why is it used?
Ans. Operating in a fashion similar to an array pointer, a cursor gives us the ability to swiftly navigate database result sets. It allows us to retrieve each row in the set separately and perform multiple operations on that row without worrying about affecting other rows in the set.
We use it, because when using cursors you’ll need to keep the following restrictions in mind:
Server-side, Read-only, Asensitive, Forward-only.

21. What are the advantages of using indexes?
Ans. The advantages of using indexes are Query optimization, Uniqueness, Text searching.

22. What is transaction?
Ans. A transaction is an ordered group of database operations that are treated as a single unit. A transaction is deemed successful if all operations in the group succeed, and is deemed unsuccessful if even a single operation fails.

23. How can you export data in mysql?
Ans.

24. Difference between before trigger and after trigger?
Ans. Before trigger: before trigger is used when validating or modifying data that you intend to insert or update. A before trigger shouldn’t be used to enforce propagation or referential integrity, because it’s possible that other before triggers could execute after it, meaning the executing trigger may be working with soon-to-be-invalid data.
After trigger: An after trigger should be used when data is to be propagated or verified against other tables, and for carrying out calculations, because we can be sure the trigger is working with the final version of the data.

25. What are the five items of the $_FILES Array?
Ans. The items of the $_FILES Array are:
  1. $_FILES['userfile']['error']
  2. $_FILES['userfile']['name']
  3. $_FILES['userfile']['size']
  4. $_FILES['userfile']['tmp_name']
  5. $_FILES['userfile']['type']

26. What is the difference between fetch_row () and fetch_array()?
Ans.

27. What is binding variables?
Ans. After a query has been prepared and executed, you can bind variables to the retrieved fields by using the bind_result() method. Its prototype follows:
class mysqli_stmt {
boolean bind_result(mixed &var1 [, mixed &varN])
}

28. What is the difference between MYISAM and InnoDB engine?
Ans. MYISAM: MyISAM became MySQL’s default storage engine as of version 3.23.1 It resolves a number of deficiencies suffered by its predecessor (ISAM). The MyISAM storage engine is particularly adept when applied to the following scenarios:
1. Select-intensive tables & 2. Insert-intensive tables.
InnoDB: InnoDB is a robust transactional storage engine released under the GNU General Public License (GPL) that has been under active development for over a decade. InnoDB tables are ideal for the following scenarios, among others:
1. Update-intensive tables, 2. Transactions & 3. Automated crash recovery.

29. What are the functions of --execute and --force option of mysql?
Ans. –execute option: This option executes a statement and quit.
--force option: This option used to continue even if an SQL error occurs.

30. What are the purposes of INFORMATION_SCHEMA database?
Ans. INFORMATION_SCHEMA is more portable than the various SHOW statements, which are entirely MySQL-specific.

No comments:

Post a Comment