Saturday, October 31, 2009

PHP Questions

1. What’s PHP ?


2. What’s the difference between include and require? 
3. How do you define a constant?   
4. How do you pass a variable by value?
5. How do I find out the number of parameters passed into function?    
6. What does a special set of tags do in PHP?
7. Are objects passed by value or by reference?
8. How do you call a constructor for a parent class?
9. What’s the special meaning of __sleep and __wakeup?
10. For printing out strings, there are echo, print and printf. Explain the differences.
11. What’s the difference between htmlentities() and htmlspecialchars()?
12. What’s the difference between md5(), crc32() and sha1() crypto on PHP? -
13. How can you count the number of site visitors?
14. A simple way to make a chat page in php?
15. Difference between mysql_fetch_row(), mysql_fetch_array() and mysql_fetch_object()
16. How can you determine the user’s ip address using php?
17. How to check the browser features?
18. What is the difference between mysql_connect and mysql_pconnect.
19. How to make a function to check whether a user is logged in or not.
20. What Is a Session?
21. What is meant by urlencode and urldecode?
22. How To Get the Uploaded File Information in the Receiving Script?
23. arrayHow can I execute a PHP script using command line?
24. How To Create a Table?
25. How To Create a Table?
26. What is the functionality of the functions STRSTR() and STRISTR()?
27. How do I find out the number of parameters passed into functions?
28. If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of $$b?
29. How To Protect Special Characters in Query String?
30. What are the differences between DROP a table and TRUNCATE a table?
31. How do you call a constructor for a parent class?
32. WHAT ARE THE DIFFERENT TYPES OF ERRORS IN PHP?
33. Would you initialize your strings with single quotes or double quotes?
34. How can we submit a form without a submit button?
35. What are the differences between GET and POST methods in form submitting, give the case where we can use GET and we can use POST methods?
36. What is the difference between the functions unlink and unset?
37. How can we create a database using PHP and mysql?
38. How many ways we can retrieve the date in result set of mysql using php?
39. I am writing an application in PHP that outputs a printable version of driving 40. directions. It contains some long sentences, and I am a neat freak, and would like to make sure that no line exceeds 50 characters. How do I accomplish that with PHP?
41. what is the functionality of ucwords
42. How can we extract string “abc.com” from a string “mailto:info@abc.com?subject=Feedback” 43. using regular expression of PHP
45. How can we know the count/number of elements of an array?
46. What are the different functions in sorting an array?
47. How many ways we can pass the variable through the navigation between the pages
48. What is the maximum length of a table name, a database name, or a field name in MySQL?
49. How many values can the SET function of MySQL take?
50. What are the other commands to know the structure of a table using MySQL commands except EXPLAIN command?
51. How can we find the number of rows in a table using MySQL?
52. What’s the difference between md5(), crc32() and sha1() crypto on PHP?
53. How can we find the number of rows in a result set using PHP?
54. How many ways we can we find the current date using MySQL?
55. Give the syntax of GRANT commands?
56. What is the difference between CHAR and VARCHAR data types?
57. How can we encrypt and decrypt a data present in a mysql table using mysql?
58. Will comparison of string “10″ and integer 11 work in PHP?
59. What is the functionality of MD5 function in PHP?
60. How can I load data from a text file into a table?
61. How can we know the number of days between two given dates using MySQL?
62. How can we change the name of a column of a table?
63. How can we change the data type of a column of a table?
64. What is the difference between GROUP BY and ORDER BY in SQL?
65. What is meant by MIME?
66. If we login more than one browser windows at the same time with same user and after that we close one window, then is the session is exist to other windows or not? And if yes then why? If no then why?
67. What are the MySQL database files stored in system ?
68. What is the difference between PHP4 and PHP5?
69. What are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()?
70. What is meant by nl2br()?
71. How can we encrypt and decrypt a data presented in a table using MySQL?
72. How can I retrieve values from one database server and store them in other database server using PHP?
73. In how many ways we can retrieve data in the result set of MYSQL using PHP?
74. What are the functions for IMAP?
75. What are encryption functions in PHP?
76. How can we get the properties (size, type, width, height) of an image using php image functions?
77. How can we increase the execution time of a php script?
78. How to set cookies?
79. What types of images that PHP supports ?
80. How many ways can we get the value of current session id?
81. What are the current versions of Apache, PHP, and MySQL?
82. What are the reasons for selecting LAMP (Linux, Apache, MySQL, Php) instead of combination of other software programs, servers and operating systems?
83. What are the features and advantages of OBJECT ORIENTED PROGRAMMING?
84. How can we get second of the current time using date function?
85. How can we get second of the current time using date function?
86. What is the maximum size of a file that can be uploaded using PHP and how can we change this?
87. How can I make a script that can be bilingual (supports English, German)?
88. What are the difference between abstract class and interface?
89. Explain normalization concept?
90. What’s the difference between accessing a class method via -> and via ::?
91. What type of inheritance that php supports?
92. When you want to show some part of a text displayed on an HTML page in red font color? What different possibilities are there to do this? What are the advantages/disadvantages of these methods?
93. What are the different ways to login to a remote server? Explain the means, advantages and disadvantages?
94. Please give a regular expression (preferably Perl/PREG style), which can be used to identify the URL from within a HTML link tag.
95. How many ways we can give the output to a browser?
96. What is the default session time in php and how can I change it?
97. What changes I have to do in php.ini file for file uploading?
98. Steps for the payment gateway processing?
99. How many ways I can redirect a PHP page?

100. List out different arguments in PHP header function?
 101. What type of headers have to be added in the mail function to attach a file?
102. What is the difference between Reply-to and Return-path in the headers of a mail function?
103. Explain about Type Juggling in php?
104. How can I embed a java programme in php file and what changes have to be done in php.ini file?
105. Explain the ternary conditional operator in PHP?
106. Explain friend function?

Thursday, October 29, 2009

PHP/MYSQL Questions

Hi Friends