Home Php Interview Questions – Part II

PHP INTERVIEW QUESTIONS

  1. 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?
  2. Who is the father of PHP and explain the changes in PHP versions?
  3. How can we submit a form without a submit button?
  4. In how many ways we can retrieve the date in the result set of mysql using PHP?
  5. What is the difference between mysql_fetch_object and mysql_fetch_array?
  6. What is the difference between $message and $$message?
  7. How can we extract string ‘abc.com ‘ from a string ‘http://[email protected]’ using regular expression of PHP?
  8. How can we create a database using PHP and mysql?
  9. What are the differences between require and include, include_once?
  10. Can we use include (”abc.PHP”) two times in a PHP page “makeit.PHP”?
  11. 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)) ?
  12. Functions in IMAP, POP3 AND LDAP?
  13. How can I execute a PHP script using command line?
  14. Suppose your Zend engine supports the mode <? ?> Then how can u configure your PHP Zend engine to support <?PHP ?> mode ?
  15. Shopping cart online validation i.e. how can we configure Paypal, etc.?
  16. What is meant by nl2br()?
  17. Draw the architecture of Zend engine?
  18. What are the current versions of apache, PHP, and mysql?
  19. What are the reasons for selecting lamp (linux, apache, mysql, PHP) instead of combination of other software programmes, servers and operating systems?
  20. How can we encrypt and decrypt a data present in a mysql table using mysql?
  21. How can we encrypt the username and password using PHP?
  22. What are the features and advantages of object-oriented programming?
  23. What are the differences between procedure-oriented languages and object-oriented languages?
  24. What is the use of friend function?
  25. What are the differences between public, private, protected, static, transient, final and volatile?
  26. What are the different types of errors in PHP?
  27. What is the functionality of the function strstr and stristr?
  28. What are the differences between PHP 3 and PHP 4 and PHP 5?
  29. How can we convert asp pages to PHP pages?
  30. What is the functionality of the function htmlentities?
  31. How can we get second of the current time using date function?
  32. How can we convert the time zones using PHP?
  33. What is meant by urlencode and urldocode?
  34. What is the difference between the functions unlink and unset?
  35. How can we register the variables into a session?
  36. How can we get the properties (size, type, width, height) of an image using PHP image functions?
  37. How can we get the browser properties using PHP?
  38. What is the maximum size of a file that can be uploaded using PHP and how can we change this?
  39. How can we increase the execution time of a PHP script?
  40. How can we take a backup of a mysql table and how can we restore it. ?
  41. How can we optimize or increase the speed of a mysql select query?
  42. How many ways can we get the value of current session id?
  43. How can we destroy the session, how can we unset the variable of a session?
  44. How can we destroy the cookie?
  45. How many ways we can pass the variable through the navigation between the pages?
  46. What is the difference between ereg_replace() and eregi_replace()?
  47. What are the different functions in sorting an array?
  48. How can we know the count/number of elements of an array?
  49. What is the PHP predefined variable that tells the What types of images that PHP supports?
  50. How can I know that a variable is a number or not using a JavaScript?
  51. List out some tools through which we can draw E-R diagrams for mysql.
  52. How can I retrieve values from one database server and store them in other database server using PHP?
  53. List out the predefined classes in PHP?
  54. How can I make a script that can be bilanguage (supports English, German)?
  55. What are the difference between abstract class and interface?
  56. How can we send mail using JavaScript?

Part – II

  1. How can we repair a MySQL table?
  2. What are the advantages of stored procedures, triggers, indexes?
  3. What is the maximum length of a table name, database name, and fieldname in MySQL?
  4. How many values can the SET function of MySQL take?
  5. What are the other commands to know the structure of table using MySQL commands except explain command?
  6. How many tables will create when we create table, what are they?
  7. What is the purpose of the following files having extensions 1) .frm 2) .myd 3) .myi? What do these files contain?
  8. What is maximum size of a database in MySQL?
  9. Give the syntax of Grant and Revoke commands?
  10. Explain Normalization concept?
  11. How can we find the number of rows in a table using MySQL?
  12. How can we find the number of rows in a result set using PHP?
  13. How many ways we can we find the current date using MySQL?
  14. What are the advantages and disadvantages of Cascading Style Sheets?
  15. What type of inheritance that PHP supports?
  16. How can increase the performance of MySQL select query?
  17. The structure of table view buyers is as follows:

+—————-+————-+——+—–+———+—————-+

| Field | Type | Null | Key | Default | Extra |

+—————-+————-+——+—–+———+—————-+

| user_pri_id | int(15) | | PRI | NULL | auto_increment |

| userid | varchar(10) | YES | | NULL | |

+—————-+————-+——+—–+———+—————-+

the value of user_pri_id the last row 2345 then What will happen in the following conditions?

Condition1: Delete all the rows and insert another row then. What is the starting value for this auto incremented field user_pri_id ,
Condition2: Delete the last row(having the field value 2345) and insert another row then. What is the value for this auto incremented field user_pri_id

  1. What are the advantages/disadvantages of MySQL and PHP?
  2. What is the difference between GROUP BY and ORDER BY in Sql?
  3. What is the difference between char and varchar data types?
  4. What is the functionality of md5 function in PHP?
  5. How can I load data from a text file into a table?
  6. How can we know the number of days between two given dates using MySQL?
  7. How can we know the number of days between two given dates using PHP?
  8. How can we change the name of a column of a table?
  9. How can we change the name and data type of a column of a table?
  10. What are the differences between drop a table and truncate a table?
  11. 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?
  12. When viewing an HTML page in a Browser, the Browser often keeps this page in its cache. What can be possible advantages/disadvantages of page caching? How can you prevent caching of a certain page (please give several alternate solutions)?
  13. What are the different methods of passing data or information between two calls of a web page? What are the advantages/disadvantages of these methods?
  14. An Apache web server is running on a Linux system. Suddenly, the web server delivers the pages very slow. How could you find out possible reasons for that (when using system commands, please specify their names)?
  15. What are the different ways to login to a remote server? Explain the means, advantages and disadvantages?
  16. Please give a regular expression (preferably Perl/PREG style), which can be used to identify the URL from within a HTML link tag. Example: The regular expression should match the tag <A HREF=”http://www.yoursite.com/”> and give the URL (”http://www.yoursite.com /”) as a return result. Tags should also be matched if they contain other attributes than the HREF attribute.
  17. A select query over a large table runs very slow because of the growing number of entries in that table. What different measures could be taken to improve speed?
  18. A company wants to store their invoices in a database. They already have their customers and articles in that database. Both customer and article are each identified by an unique integer value. Please create the SQL statements for creating the necessary table(s) for storing the invoices in a MySQL database. An invoice should hold information like invoice number, customer, date, article(s) and quantity etc.
  19. For the database from the previous question, please give an SQL query which returns the invoice number of all invoices which contain the article with the number “1234?. The query should be able to run under a MySQL 4.0 database.
  20. How would you backup and restore a big MySQL database? What are the advantages of the approach which you have taken over the others?
  21. Create a PHP web script with the following attributes: on start, three HTML form elements are shown: an string input field, a checkbox field, a dropdown/pull down list with 5 elements and a submit button. On submission, the form should be redisplayed (while remaining all options/inputs as the user has selected/entered them). Additionally, the selections/inputs of the user should be displayed in text. Please solve this without the use of any external libraries.
  22. What is MIME?
  23. What is PEAR in PHP?
  24. How can I use the COM components in PHP?
  25. How can I load the DLLs dynamically?
  26. How many ways we can give the output to a browser?
  27. How can we know that a session is started or not?
  28. What is the default session time in PHP and how can I change it?
  29. What changes I have to done in PHP.ini file for file uploading?
  30. What are the differences between MySQL_fetch_array(), MySQL_fetch_object(), MySQL_fetch_row()?
  31. How can I set a cron and how can i execute it in Unix, Linux, and windows?
  32. Steps for the payment gateway processing?
  33. How many ways I can register the variables into session?
  34. Explain different types of errors in PHP (i.e. arguments in errorreporting function)?
  35. How many ways I can redirect a PHP page?
  36. List out different arguments in PHP header function?
  37. What type of headers have to add in the mail function in which file a attached?
  38. What is the difference between
  39. What are the differences between PHP3 and PHP4 versions?
  40. What are the differences between include() and include_once() functions?
  41. Describe the importance of DABA BASE ABSTRACTION LAYERS in PHP and database connection?
  42. Explain MySQL optimization?
  43. What is the difference between using copy() and move() function in PHP file uploading?
  44. What is the difference between Reply-to and Return-path in the headers of a mail function?
  45. Explain about Type Juggling in PHP?
  46. How can I get the only name of the current executing file?
  47. How can I embed a java programme in PHP file and what changes have to be done in PHP.ini file?
  48. How can I find what type of images that the PHP version supports?
  49. The table tbl_sites contains the following data:

—————————————————–

Userid sitename country

——————————————————

1 sureshbabu indian

2 PHPprogrammer andhra

3 PHP.net usa

4 PHPtalk.com germany

5 MySQL.com usa

6 sureshbabu canada

7 PHPbuddy.com pakistan

8. PHPtalk.com austria

9. PHPfreaks.com sourthafrica

10. PHPsupport.net russia

11. sureshbabu australia

12. sureshbabu nepal

13. PHPtalk.com italy

Write a select query that will displayed the duplicated site name and how many times it is duplicated? …

Leave a Comment