Thursday 26 April 2012

PHP Interview question 4


 1) Who is the father of PHP ?
Ans : Rasmus Lerdorf is known as the father of PHP.
             
 2) What is the difference between $name and $$name?
Ans : $name is variable where as $$name is reference variable
like $name=sonia and $$name=singh so $sonia value is singh.
             
3) How can we submit a form without a submit button?
Ans:  Java script submit() function is used for submit form without submit button
on click call document.formname.submit()  
             
4)  In how many ways we can retrieve the data in the result set of MySQL using PHP?
Ans :   We can do it by 4 Ways
1. mysql_fetch_row. , 2. mysql_fetch_array , 3. mysql_fetch_object
4. mysql_fetch_assoc
             
5) What is the difference between mysql_fetch_object and mysql_fetch_array?
Ans : mysql_fetch_object() is similar tomysql_fetch_array(), with one difference -
an object is returned, instead of an array. Indirectly, that means that
you can only access the data by the field names, and not by their
offsets (numbers are illegal property names).

No comments:

Post a Comment