Q.1 What's PHP
ANSWER:
The PHP Hypertext Preprocessor is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications.
Q.2 What is meant by PEAR in php?
ANSWER :
PEAR is the next revolution in PHP. This repository is bringing higher level programming to PHP. PEAR is a framework and distribution system for reusable PHP components. It eases installation by bringing an automated wizard, and packing the strength and experience of PHP users into a nicely organised OOP library. PEAR also provides a command-line interface that can be used to automatically install "packages"
Q.3 How can we repair a MySQL table?
ANSWER:
The syntex for repairing a mysql table is:
REPAIR TABLE tablename
REPAIR TABLE tablename QUICK
REPAIR TABLE tablename EXTENDED
This command will repair the table specified.
If QUICK is given, MySQL will do a repair of only the index tree.
If EXTENDED is given, it will create index row by row.
Q.4 What are the differences between require and include, include_once?
ANSWER 1:
require_once() and include_once() are both the functions to include and evaluate the specified file only once. If the specified file is included previous to the present call occurrence, it will not be done again.
But require() and include() will do it as many times they are asked to do.
ANSWER 2:
The include_once() statement includes and evaluates the specified file during the execution of the script. This is a behavior similar to the include() statement, with the only difference being that if the code from a file has already been included, it will not be included again. The major difference between include() and require() is that in failure include() produces a warning message whereas require() produces a fatal errors.
Q.5 What are the differences between DROP a table and TRUNCATE a table?
ANSWER:
DROP TABLE table_name - This will delete the table and its data.
TRUNCATE TABLE table_name - This will delete the data of the table, but not the table definition.
Q.6 How can we register the variables into a session?
ANSWER:
session_register($session_var);
$_SESSION['var'] = 'value';
Q.7 How many error types in php?
ANSWER:
1:fatal
2:notice
3:warning
4:parse
Q.8 difference of move(), and copy() function in php?
ANSWER:
copy() function copy images for temp folder on server to
move other location. move() function cut images for temp
folder on server to move other location.
Q.9 What are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()?
ANSWER:
mysql_fetch_array() -> Fetch a result row as a combination of associative array and regular array.
mysql_fetch_object() -> Fetch a result row as an object.
mysql_fetch_row() -> Fetch a result set as a regular array().
Q.10 What is the difference between PHP4 and PHP5?
ANSWER:
PHP4 cannot support oops concepts and Zend engine 1 is used.
PHP5 supports oops concepts and Zend engine 2 is used.
Error supporting is increased in PHP5.
XML and SQLLite will is increased in PHP5.