Set - 6

Question 6 :

What are the MySQL database files stored in system ?

Answer :

Data is stored in name.myd
Table structure is stored in name.frm
Index is stored in name.myi


Question 7 :

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.


Question 8 :

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

Answer :

Yes we can include that many times we want, but here are some things to make sure of:
(including abc.PHP, the file names are case-sensitive)
there shouldn't be any duplicate function names, means there should not be functions or classes or variables with the same name in abc.PHP and makeit.php


Question 9 :

What are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()?

Answer :

mysql_fetch_array - Fetch a result row as an associative array and a numeric array.

mysql_fetch_object - Returns an object with properties that correspond to the fetched row and moves the internal data pointer ahead. Returns an object with properties that correspond to the fetched row, or FALSE if there are no more rows

mysql_fetch_row() - Fetches one row of data from the result associated with the specified result identifier. The row is returned as an array. Each result column is stored in an array offset, starting at offset 0.


Question 10 :

What is meant by nl2br()?

Answer :

Anwser1:
nl2br() inserts a HTML tag <br> before all new line characters \n in a string.

echo nl2br("god bless \n you");

output:
god bless<br>
you