Sunday, September 23, 2007

php questions and answers

8. What are the differences between require and include, include_once?

A: Require:

i. It produces fatal error at the time of occurring problem

ii. It will not proceed next step to process if it is fatal error.

Include:

i. It produces warning messages at the time of occurring problem

ii. It will proceed next step to process if it is warning messages.

include_once:

i. It is like include.

ii. If the specified file is opened previously to the present call occurance, it will not done again.

9. Can we use include (”abc.PHP”) two times in a PHP page “makeit.PHP”?

A: Sure, we can include.

10. What are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee(eno int(2),ename varchar(10)) ?

A: Six types of table we can create. There are,

i. ISAM

ii. MyISAM

iii.Merge

iv. Heap

v. BDB

vi. InnoDB

MyISAM is the default storage engine for MySQL 3.23

11. How can I execute a PHP script using command line?

A: php parse is used to execute a PHP script

12. What is meant by nl2br()?

A: It is like
tag. It returns string with after inserting HTML line breaks before all new line in a string.

13. What are the current versions of apache, PHP, and mysql?

A: php 5.1.2

MySQL 5.1

Apache 2.1

14. How can we encrypt and decrypt a data present in a mysql table using mysql?

A: AES_ENCRYPT(str, key_str) , AES_DECRYPT(crypt_str, key_str)

15. How can we encrypt the username and password using PHP?

A: $ username =Md5(“username”);

$ password =Md5(“password”);

16. What are the features and advantages of object-oriented programming?

A: i. It reduce the coding.

ii. Ease of modification.

iii. Ease of understand

iv. It allows for more complicated and flexible interactions

v. It allows reusability

17. What are the differences between procedure-oriented languages and object-oriented languages?

A: procedure-oriented

Here functions are written sequentially

Code and data are kept separate. Multiple sets of code can access and modify one set of data.

No comments: