Vous êtes sur la page 1sur 60

Home About My Resume PHP-MySQL Interview Question Plugins

Search

Boolean Dreams
Feeds: Posts Comments

PHP-MySQL Interview Question


Last few days I have been working to compile a question and answer set for PHP-MySQL interview questions. There are roughly 150 questions and i will be adding more as days to come. These questions and answers are compiled from different online resources. I am planning to make it a PDF version so that people download it and go through it offline. I hope i will be able to finish it soon. NB: If you want to add any question, please add it to the comments section. I want to make it a big repository. Here is the first set of 80 Questions and answer.
Q:1 A :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?

When to use GET or POST


The HTML 2.0 specification says, in section Form Submission (and the HTML 4.0 specification repeats this with minor stylistic changes): >If the processing of a form is idempotent (i.e. it has no lasting observable effect on the state of the world), then the form method should be GET. Many database searches have no visible side-effects and make ideal applications of query forms. >If the service associated with the processing of a form has side effects (for example, modification of a database or subscription to a service), the method should be POST.

How the form data is transmitted?


quotation from the HTML 4.0 specification > If the method is get -, the user agent takes the value of action, appends a ? to it, then appends the form data set, encoded using the application/x-www-form-urlencoded content type. The user agent then traverses the link to this URI. In this scenario, form data are restricted to ASC II codes. > If the method is post , the user agent conducts an HTTP post transaction using the value of the action attribute and a message

created according to the content type specified by the enctype attribute.

Quote from CGI FAQ


Firstly, the the HTTP protocol specifies differing usages for the two methods. GET requests should always be idempotent on the server. This means that whereas one GET request might (rarely) change some state on the Server, two or more identical requests will have no further effect. This is a theoretical point which is also good advice in practice. If a user hits reload on his/her browser, an identical request will be sent to the server, potentially resulting in two identical database or guestbook entries, counter increments, etc. Browsers may reload a GET URL automatically, particularly if cacheing is disabled (as is usually the case with C GI output), but will typically prompt the user before re-submitting a POST request. This means youre far less likely to get inadvertently-repeated entries from POST. GET is (in theory) the preferred method for idempotent operations, such as querying a database, though it matters little if youre using a form. There is a further practical constraint that many systems have built-in limits to the length of a GET request they can handle: when the total size of a request (URL+params) approaches or exceeds 1Kb, you are well-advised to use POST in any case. I would prefer POST when I dont want the status to be change when user resubmits. And GET when it does not matter.

Q:2 A:2

Who is the father of PHP and explain the changes in PHP versions? Rasmus Lerdorf is known as the father of PHP.PHP/FI 2.0 is an early and no longer supported version of PHP. PHP 3 is the successor to PHP/FI 2.0 and is a lot nicer. PHP 4 is the current generation of PHP, which uses the Zend engine under the hood. PHP 5 uses Zend engine 2 which, among other things, offers many additionalOOP features How can we submit a form without a submit button? The main idea behind this is to use Java script submit() function in order to submit the form without explicitly clicking any submit button. You can attach the document.formname.submit() method to onclick, onchange events of different inputs and perform the form submission. you can even built a timer function where you can automatically submit the form after xx seconds once the loading is done (can be seen in online test sites).

Q:3 A:3

Q:4 A:4

In how many ways we can retrieve the data in the result set of MySQL using PHP? You can do it by 4 Ways1. mysql_fetch_row. 2. mysql_fetch_array 3. mysql_fetch_object 4. mysql_fetch_assoc What is the difference between mysql_fetch_object and mysql_fetch_array?

Q:5

A:5

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). What is the difference between $message and $$message? It is a classic example of PHPs variable variables. take the following example.$message = Mizan;$$message = is a moderator of PHPXperts.;$message is a simple PHP variable that we are used to. But the $$message is not a very familiar face. It creates a variable name $mizan with the value is a moderator of PHPXperts. assigned. break it like this${$message} => $mizanSometimes it is convenient to be able to have variable variable names. That is, a variable name which can be set and used dynamically. How can we extract string abc.com from a string http://info@abc.com using regular expression of PHP? preg_match(/^http:\/\/.+@(.+)$/,http://info@abc.com,$found); echo $found[1]; How can we create a database using PHP and MySQL? We can create MySQL database with the use of mysql_create_db(Database Name) What are the differences between require and include, include_once and require_once? The include() statement includes and evaluates the specified file.The documentation below also applies to require(). The two constructs are identical in every way except how they handle failure. include() produces a Warning while require() results in a Fatal Error. In other words, use require() if you want a missing file to halt processing of the page. include() does not behave this way, the script will continue regardless. 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. As the name suggests, it will be included just once.include_once() should be used in cases where the same file might be included and evaluated more than once during a particular execution of a script, and you want to be sure that it is included exactly once to avoid problems with function redefinitions, variable value reassignments, etc. require_once() should be used in cases where the same file might be included and evaluated more than once during a particular execution of a script, and you want to be sure that it is included exactly once to avoid problems with function redefinitions, variable value reassignments, etc.

Q:6 A:6

Q:7 A:7

Q:8 A:8

Q:9 A:9

Q:10 Can we use include (abc.PHP) two times in a PHP page makeit.PHP? A:10 Yes we can use include() more than one time in any page though it is not a very good practice. Q: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)) ? A:11 Total 5 types of tables we can create 1. MyISAM 2. Heap 3. Merge 4. INNO DB 5. ISAM MyISAM is the default storage engine as of MySQL 3.23 and as a result if we do not specify the table name explicitly it will be assigned to the default engine. Q:12 Functions in IMAP, POP3 AND LDAP? A:12 You can find these specific information in PHP Manual. Q:13 How can I execute a PHP script using command line? A:13 As of version 4.3.0, PHP supports a new SAPI type (Server Application Programming Interface) named C LI which means C ommand Line Interface. Just run the PHP C LI (C ommand Line Interface) program and provide the PHP script file name as the command line argument. For example, php myScript.php, assuming php is the command to invoke the C LI program. Be aware that if your PHP script was written for the Web C GI interface, it may not execute properly in command line environment.

Q:14 Suppose your Zend engine supports the mode <? ?> Then how can u configure your PHP Zend engine to support <?PHP ?> mode ? A:14 In php.ini file: set short_open_tag=on to make PHP support Q:15 Shopping cart online validation i.e. how can we configure Paypal, etc.? A:15 We can find the detail documentation about different paypal integration process at the following site

PayPal PHP SDK : http://www.paypaldev.org

Q:16 What is meant by nl2br()? A:16 Inserts HTML line breaks (<BR />) before all newlines in a string string nl2br (string); Returns string with inserted before all newlines. For example: echo nl2br(god bless\n you) will output god bless <br /> you to your browser. Q:17 Draw the architecture of Zend engine? A:17 The Zend Engine is the internal compiler and runtime engine used by PHP4. Developed by Zeev Suraski and Andi Gutmans, the Zend Engine is an

PHP4. Developed by Zeev Suraski and Andi Gutmans, the Zend Engine is an abbreviation of their names. In the early days of PHP4, it worked as follows:

The PHP script was loaded by the Zend Engine and compiled into Zend opcode. Opcodes, short for operation codes, are low level binary instructions. Then the opcode was executed and the HTML generated sent to the client. The opcode was flushed from memory after execution.Today, there are a multitude of products and techniques to help you speed up this process. In the following diagram, we show the how modern PHP scripts work; all the shaded boxes are optional.

PHP Scripts are loaded into memory and compiled into Zend opcodes.

Q:18 What are the current versions of apache, PHP, and MySQL? A:18 As of February, 2007 the current versions arePHP: php5.2.1 MySQL: MySQL 5.2 Apache: Apache 2.2.4Note: visit www.php.net, http://dev.mysql.com/downloads/mysql/, www.apache.org to get current versions.

Q:19 What are the reasons for selecting lamp (Linux, apache, MySQL, PHP) instead of combination of other software programs, servers and operating systems? A:19 All of those are open source resource. Security of Linux is very very more than windows. Apache is a better server that IIS both in functionality and security. MySQL is world most popular open source database. PHP is more faster that asp or any other scripting language.

Q:20 How can we encrypt and decrypt a data present in a MySQL table using MySQL? A:20 AES_ENC RYPT () and AES_DEC RYPT () Q:21 How can we encrypt the username and password using PHP? A:21 The functions in this section perform encryption and decryption, and compression and uncompression:

encryption AES_ENCRYT() ENCODE() DES_ENCRYPT() ENCRYPT() MD5() PASSWORD() SHA() or SHA1() Not available

decryption AES_DECRYPT() DECODE() DES_DECRYPT() Not available Not available Not available Not available UNCOMPRESSED_LENGTH()

OLD_PASSWORD() Not available

Q:22 What are the features and advantages of object-oriented programming? A:22 One of the main advantages of OO programming is its ease of modification; objects can easily be modified and added to a system there by reducing maintenance costs. OO programming is also considered to be better at modeling the real world than is procedural programming. It allows for more complicated and flexible interactions. OO systems are also easier for non-technical personnel to understand and easier for them to participate in the maintenance and enhancement of a system because it appeals to natural human cognition patterns. For some systems, an OO approach can speed development time since many objects are standard across systems and can be reused. C omponents that manage dates, shipping, shopping carts, etc. can be purchased and easily modified for a specific system Q:23 What are the differences between procedure-oriented languages and object-oriented languages? A:23 Traditional programming has the following characteristics:Functions are written sequentially, so that a change in programming can affect any code that follows it. If a function is used multiple times in a system (i.e., a piece of code that manages the date), it is often simply cut and pasted into each program (i.e., a change log, order function, fulfillment system, etc). If a date change is needed (i.e., Y2K when the code needed to be changed to handle four numerical digits instead of two), all these pieces of code must be found, modified, and tested. C ode (sequences of computer instructions) and data (information on which the instructions operates on) are kept separate. Multiple sets of code can access and modify one set of data. One set of code may rely on data in multiple places. Multiple sets of code and data are required to work together. C hanges made to any of the code sets and data sets can cause problems through out the system.Object-Oriented programming takes a radically different approach:C ode and data are merged into one indivisible item an object (the term component has also been used to describe an object.) An object is an abstraction of a set of real-world things (for example, an object may be created around date) The object would contain all information and functionality for that thing (A date object it may contain labels like January, February, Tuesday, Wednesday. It may contain functionality that manages leap years, determines if it is a business day or a holiday, etc., See Fig. 1). Ideally, information

is a business day or a holiday, etc., See Fig. 1). Ideally, information about a particular thing should reside in only one place in a system. The information within an object is encapsulated (or hidden) from the rest of the system. A system is composed of multiple objects (i.e., date function, reports, order processing, etc., See Fig 2). When one object needs information from another object, a request is sent asking for specific information. (for example, a report object may need to know what todays date is and will send a request to the date object) These requests are called messages and each object has an interface that manages messages. OO programming languages include features such as class, instance, inheritance, and polymorphism that increase the power and flexibility of an object. Q:24 What is the use of friend function? A:24 Sometimes a function is best shared among a number of different classes. Such functions can be declared either as member functions of one class or as global functions. In either case they can be set to be friends of other classes, by using a friend specifier in the class that is admitting them. Such functions can use all attributes of the class which names them as a friend, as if they were themselves members of that class. A friend declaration is essentially a prototype for a member function, but instead of requiring an implementation with the name of that class attached by the double colon syntax, a global function or member function of another class provides the match. Q:25 What are the differences between public, private, protected, static, transient, final and volatile? A:25 Public: Public declared items can be accessed everywhere. Protected: Protected limits access to inherited and parent classes (and to the class that defines the item). Private: Private limits visibility only to the class that defines the item. Static: A static variable exists only in a local function scope, but it does not lose its value when program execution leaves this scope. Final: Final keyword prevents child classes from overriding a method by prefixing the definition with final. If the class itself is being defined final then it cannot be extended. transient: A transient variable is a variable that may not be serialized. volatile: a variable that might be concurrently modified by multiple threads should be declared volatile. Variables declared to be volatile will not be optimized by the compiler because their value can change at any time. Q:26 What are the different types of errors in PHP? A:26 Three are three types of errors:1. Notices: These are trivial, non-critical errors that PHP encounters while executing a script for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all although, as you will see, you can change this default behavior.2. Warnings: These are more serious errors for example, attempting to include() a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination.3. Fatal errors: These are critical errors for example, instantiating an object of a non-existent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHPs default behavior is to display them to the user when they take place. Q:27 What is the functionality of the function strstr and stristr? A:27 strstr: Returns part of haystack

string from the first occurrence of needle to the end of haystack.If needle is not found, returns FALSE . If needle is not a string, it is converted to an integer and applied as the ordinal value of a character. This function is case-sensitive. For case-insensitive searches, use stristr(). Q:28 What are the differences between PHP 3 and PHP 4 and PHP 5? A:28 Please read the release notes at http://www.php.net. Q:29 How can we convert asp pages to PHP pages? A:29 there are lots of tools available for asp to PHP conversion. you can search Google for that. the best one is available athttp://asp2php.naken.cc./ Q:30 What is the functionality of the function htmlentities? A:30 C onvert all applicable characters to HTML entities This function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities. Q:31 How can we get second of the current time using date function? A:31 $second = date(s); Q:32 How can we convert the time zones using PHP? A:32 By using date_default_timezone_get and date_default_timezone_set function on PHP 5.1.0 <?php // Discover what 8am in Tokyo relates to on the East Coast of the US // Set the default timezone to Tokyo time: date_default_timezone_set('Asia/Tokyo'); // Now generate the timestamp for that particular timezone, on Jan 1st, 2000 $stamp = mktime(8, 0, 0, 1, 1, 2000); // Now set the timezone back to US/Eastern date_default_timezone_set('US/Eastern'); // Output the date in a standard format (RFC1123), this will print: // Fri, 31 Dec 1999 18:00:00 EST echo '<p>', date(DATE_RFC1123, $stamp) ,'</p>';?>

Q:33 What is meant by urlencode and urldocode? A:33 URLencode returns a string in which all non-alphanumeric characters except -_. have been replaced with a percent (%) sign followed by two hex digits and spaces encoded as plus (+) signs. It is encoded the same way that the posted data from a WWW form is encoded, that is the same way as in application/x-www-form-urlencoded media type. urldecode decodes any %## encoding in the given string.

encoding in the given string.

Q:34 What is the difference between the functions unlink and unset? A:34 unlink() deletes the given file from the file system. unset() makes a variable undefined. Q:35 How can we register the variables into a session? A:35 $_SESSION[name] = Mizan; Q:36 How can we get the properties (size, type, width, height) of an image using PHP image functions? A:36 To To To To know know know know the the the the Image type use exif_imagetype () function Image size use getimagesize () function image width use imagesx () function image height use imagesy() function t

Q:37 How can we get the browser properties using PHP? A:37 By using $_SERVER['HTTP_USER_AGENT'] variable.

Q:38 What is the maximum size of a file that can be uploaded using PHP and how can we change this? A:38 By default the maximum size is 2MB. and we can change the following setup at php.iniupload_max_filesize = 2M Q:39 How can we increase the execution time of a PHP script? A:39 by changing the following setup at php.inimax_execution_time = 30 ; Maximum execution time of each script, in seconds Q:40 How can we take a backup of a MySQL table and how can we restore it. ? A:40 To backup: BAC KUP TABLE tbl_name[,tbl_name] TO /path/to/backup/directory RESTORE TABLE tbl_name[,tbl_name] FROM /path/to/backup/directorymysqldump: Dumping Table Structure and DataUtility to dump a database or a collection of database for backup or for transferring the data to another SQL server (not necessarily a MySQL server). The dump will contain SQL statements to create the table and/or populate the table. -t, no-create-info Dont write table creation information (the C REATE TABLE statement). -d, no-data Dont write any row information for the table. This is very useful if you just want to get a dump of the structure for a table! Q:41 How can we optimize or increase the speed of a MySQL select query? A:41 first of all instead of using select * from table1, use select column1, column2, column3.. from table1 Look for the opportunity to introduce index in the table you are querying. use limit keyword if you are looking for any specific number of rows from the result set.

Q:42 How many ways can we get the value of current session id?

A:42 session_id() returns the session id for the current session. Q:43 How can we destroy the session, how can we unset the variable of a session? A:43 session_unregister Unregister a global variable from the current session session_unset Free all session variables Q:44 How can we destroy the cookie? A:44 Set the cookie in past. Q:45 How many ways we can pass the variable through the navigation between the pages? A:45 GET/QueryString POST

Q:46 What is the difference between ereg_replace() and eregi_replace()? A:46 eregi_replace() function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic characters.eregi_replace() function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic characters. Q:47 What are the different functions in sorting an array? A:47 Sort(), arsort(), asort(), ksort(), natsort(), natcasesort(), rsort(), usort(), array_multisort(), and uksort(). Q:48 How can we know the count/number of elements of an array? A:48 2 ways a) sizeof($urarray) This function is an alias of count() b) count($urarray) Q:49 What is the PHP predefined variable that tells the What types of images that PHP supports? A:49 Though i am not sure if this is wrong or not, With the exif extension you are able to work with image meta data. Q:50 How can I know that a variable is a number or not using a JavaScript? A:50 bool is_numeric ( mixed var) Returns TRUE if var is a number or a numeric string, FALSE otherwise.or use isNaN(mixed var)The isNaN() function is used to check if a value is not a number. Q:51 List out some tools through which we can draw E-R diagrams for mysql. A:51 C ase Studio Smart Draw Q:52 How can I retrieve values from one database server and store them in other database server using PHP? A:52 we can always fetch from one database and rewrite to another. here

is a nice solution of it.$db1 = mysql_connect(host,user,pwd) mysql_select_db(db1, $db1); $res1 = mysql_query(query,$db1);$db2 = mysql_connect(host,user,pwd) mysql_select_db(db2, $db2); $res2 = mysql_query(query,$db2);At this point you can only fetch records from you previous ResultSet, i.e $res1 But you cannot execute new query in $db1, even if you supply the link as because the link was overwritten by the new db.so at this point the following script will fail $res3 = mysql_query(query,$db1); //this will failSo how to solve that? take a look below. $db1 = mysql_connect(host,user,pwd) mysql_select_db(db1, $db1); $res1 = mysql_query(query,$db1); $db2 = mysql_connect(host,user,pwd, true) mysql_select_db(db2, $db2); $res2 = mysql_query(query,$db2); So mysql_connect has another optional boolean parameter which indicates whether a link will be created or not. as we connect to the $db2 with this optional parameter set to true, so both link will remain live. now the following query will execute successfully. $res3 = mysql_query(query,$db1); Thanks goes to Hasan and Hasin for this solution. Q:53 List out the predefined classes in PHP? A:53 Directory stdC lass __PHP_Incomplete_C lass exception php_user_filter Q:54 How can I make a script that can be bi-language (supports English, German)? A:54 You can maintain two separate language file for each of the language. all the labels are putted in both language files as variables and assign those variables in the PHP source. on runtime choose the required language option. Q:55 What are the difference between abstract class and interface? A:55 Abstract class: abstract classes are the class where one or more methods are abstract but not necessarily all method has to be abstract. Abstract methods are the methods, which are declare in its class but not define. The definition of those methods must be in its extending class.Interface: Interfaces are one type of class where all the methods are abstract. That means all the methods only declared but not defined. All the methods must be define by its implemented class. Q:56 How can we send mail using JavaScript? A:56 JavaScript does not have any networking capabilities as it is designed to work on client site. As a result we can not send mails using JavaScript. But we can call the client side mail protocol mailto via JavaScript to prompt for an email to send. this requires the client to approve it. Q:57 How can we repair a MySQL table? A:57 The syntex for repairing a MySQL table is REPAIR TABLENAME, [TABLENAME, ], [Quick],[Extended] This command will repair the table specified if the quick is given the

MySQL will do a repair of only the index tree if the extended is given it will create index row by row Q:58 What are the advantages of stored procedures, triggers, indexes? A:58 A stored procedure is a set of SQL commands that can be compiled and stored in the server. Once this has been done, clients dont need to keep re-issuing the entire query but can refer to the stored procedure. This provides better overall performance because the query has to be parsed only once, and less information needs to be sent between the server and the client. You can also raise the conceptual level by having libraries of functions in the server. However, stored procedures of course do increase the load on the database server system, as more of the work is done on the server side and less on the client (application) side.Triggers will also be implemented. A trigger is effectively a type of stored procedure, one that is invoked when a particular event occurs. For example, you can install a stored procedure that is triggered each time a record is deleted from a transaction table and that stored procedure automatically deletes the corresponding customer from a customer table when all his transactions are deleted.Indexes are used to find rows with specific column values quickly. Without an index, MySQL must begin with the first row and then read through the entire table to find the relevant rows. The larger the table, the more this costs. If the table has an index for the columns in question, MySQL can quickly determine the position to seek to in the middle of the data file without having to look at all the data. If a table has 1,000 rows, this is at least 100 times faster than reading sequentially. If you need to access most of the rows, it is faster to read sequentially, because this minimizes disk seeks. Q:59 What is the maximum length of a table name, database name, and fieldname in MySQL? A:59 The following table describes the maximum length for each type of identifier.

Identifier

Maximum Length (bytes) 64 64 64 255

Database 64 Table Column Index Alias

There are some restrictions on the characters that may appear in identifiers:

Q:60 How many values can the SET function of MySQL take? A:60 MySQL set can take zero or more values but at the maximum it can take 64 values Q:61 What are the other commands to know the structure of table using MySQL commands except explain command? A:61 describe Table-Name; Q:62 How many tables will create when we create table, what are they? A:62 The .frm file stores the table definition. The data file has a .MYD (MYData) extension. The index file has a .MYI (MYIndex) extension,

Q:63 What is the purpose of the following files having extensions 1) .frm 2) .myd 3) .myi? What do these files contain? A:63 In MySql, the default table type is MyISAM. Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type. The .frm file stores the table definition. The data file has a .MYD (MYData) extension. The index file has a .MYI (MYIndex) extension, Q:64 What is maximum size of a database in MySQL? A:64 If the operating system or filesystem places a limit on the number of files in a directory, MySQL is bound by that constraint.The efficiency of the operating system in handling large numbers of files in a directory can place a practical limit on the number of tables in a database. If the time required to open a file in the directory increases significantly as the number of files increases, database performance can be adversely affected. The amount of available disk space limits the number of tables. MySQL 3.22 had a 4GB (4 gigabyte) limit on table size. With the MyISAM storage engine in MySQL 3.23, the maximum table size was increased to 65536 terabytes (2567 1 bytes). With this larger allowed table size, the maximum effective table size for MySQL databases is usually determined by operating system constraints on file sizes, not by MySQL internal limits.The InnoDB storage engine maintains InnoDB tables within a tablespace that can be created from several files. This allows a table to exceed the maximum individual file size. The tablespace can include raw disk partitions, which allows extremely large tables. The maximum tablespace size is 64TB. The following table lists some examples of operating system file-size limits. This is only a rough guide and is not intended to be definitive. For the most up-to-date information, be sure to check the documentation specific to your operating system. Operating System File-size LimitLinux 2.2-Intel 32-bit 2GB (LFS: 4GB) Linux 2.4+ (using ext3 filesystem) 4TB Solaris 9/10 16TB NetWare w/NSS filesystem 8TB Win32 w/ FAT/FAT32 2GB/4GB Win32 w/ NTFS 2TB (possibly larger) MacOS X w/ HFS+ 2TB Q:65 Give the syntax of Grant and Revoke commands? A:65 The generic syntax for grant is as following > GRANT [rights] on [database/s] TO [username@hostname] IDENTIFIED BY [password] now rights can be a) All privileges b) combination of create, drop, select, insert, update and delete etc.We can grant rights on all databse by using *.* or some specific database by database.* or a specific table by database.table_name username@hotsname can be either username@localhost, username@hostname and username@% where hostname is any valid hostname and % represents any name, the *.* any condition password is simply the password of userThe generic syntax for revoke is as following > REVOKE [rights] on [database/s] FROM [username@hostname] now rights can be as explained above a) All privileges b) combination of create, drop, select, insert, update and delete etc. username@hotsname can be either username@localhost, username@hostname and username@% where hostname is any valid hostname and % represents any name, the *.* any condition Q:66 Explain Normalization concept? A:66 The normalization process involves getting our data to conform to

A:66 The normalization process involves getting our data to conform to three progressive normal forms, and a higher level of normalization cannot be achieved until the previous levels have been achieved (there are actually five normal forms, but the last two are mainly academic and will not be discussed).First Normal FormThe First Normal Form (or 1NF) involves removal of redundant data from horizontal rows. We want to ensure that there is no duplication of data in a given row, and that every column stores the least amount of information possible (making the field atomic).Second Normal FormWhere the First Normal Form deals with redundancy of data across a horizontal row, Second Normal Form (or 2NF) deals with redundancy of data in vertical columns. As stated earlier, the normal forms are progressive, so to achieve Second Normal Form, your tables must already be in First Normal Form.Third Normal Form I have a confession to make; I do not often use Third Normal Form. In Third Normal Form we are looking for data in our tables that is not fully dependant on the primary key, but dependant on another value in the table

Q:67 How can we find the number of rows in a table using MySQL? A:67 Use this for mysql >SELEC T C OUNT(*) FROM table_name; Q:68 How can we find the number of rows in a result set using PHP? A:68 $result = mysql_query($sql, $db_link); $num_rows = mysql_num_rows($result); echo "$num_rows rows found";

Q:69 How many ways we can we find the current date using MySQL? A:69 SELEC T C URDATE(); C URRENT_DATE() = C URDATE() for time use SELEC T C URTIME(); C URRENT_TIME() = C URTIME() Q:70 What are the advantages and disadvantages of Cascading Style Sheets? A:70 External Style SheetsAdvantagesC an control styles for multiple documents at once. C lasses can be created for use on multiple HTML element types in many documents. Selector and grouping methods can be used to apply styles under complex contextsDisadvantagesAn extra download is required to import style information for each document The rendering of the document may be delayed until the external style sheet is loaded Becomes slightly unwieldy for small quantities of style definitionsEmbedded Style Sheets Advantages C lasses can be created for use on multiple tag types in the document. Selector and grouping methods can be used to apply styles under complex contexts. No additional downloads necessary to receive style information Disadvantages This method can not control styles for multiple documents at once Inline Styles Advantages Useful for small quantities of style definitions. C an override other style specification methods at the local level so only exceptions need to be listed in conjunction with other style methods Disadvantages

Does not distance style information from content (a main goal of SGML/HTML). C an not control styles for multiple documents at once. Author can not create or control classes of elements to control multiple element types within the document. Selector grouping methods can not be used to create complex element addressing scenarios

Q:71 What type of inheritance that PHP supports? A:71 In PHP an extended class is always dependent on a single base class, that is, multiple inheritance is not supported. C lasses are extended using the keyword extends. Q:72 What is the difference between Primary Key and Unique key? A:72 Primary Key: A column in a table whose values uniquely identify the rows in the table. A primary key value cannot be NULL. Unique Key: Unique Keys are used to uniquely identify each row in the table. There can be one and only one row for each unique key value. So NULL can be a unique key.There can be only one primary key for a table but there can be more than one unique for a table.

The structure of table view buyers is as follows: Q:73

Field user_pri_id userid

Type int(15) varc har(10)

Null Key Default PRI YES null null

Extra auto_increment

the value of user_pri_id the last row 999 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 999) and insert another row then. What is the value for this auto incremented field user_pri_id A:73 In both cases let the value for auto increment field be n then next row will have value n+1 i.e. 1000 Q:74 What are the advantages/disadvantages of MySQL and PHP? A:74 Both of them are open source software (so free of cost), support cross platform. php is faster then ASP and JSP. Q:75 What is the difference between GROUP BY and ORDER BY in Sql? A:75 ORDER BY [col1],[col2],,[coln]; Tels DBMS according to what columns it should sort the result. If two rows will hawe the same value in col1 it will try to sort them according to col2 and so on.GROUP BY [col1],[col2],,[coln]; Tels DBMS to group results with same value of column col1. You can use C OUNT(col1), SUM(col1), AVG(col1) with it, if you want to count all items in group, sum all values or view average Q:76 What is the difference between char and varchar data types? A:76 Set char to occupy n bytes and it will take n bytes even if u r storing a value of n-m bytes Set varchar to occupy n bytes and it will take only the required space and will not use the n bytes eg. name char(15) will waste 10 bytes if we store mizan, if each char takes a byte

takes a byte eg. name varchar(15) will just use 5 bytes if we store mizan, if each char takes a byte. rest 10 bytes will be free. Q:77 What is the functionality of md5 function in PHP? A:77 C alculate the md5 hash of a string. The hash is a 32-character hexadecimal number. I use it to generate keys which I use to identify users etc. If I add random no techniques to it the md5 generated now will be totally different for the same string I am using. Q:78 How can I load data from a text file into a table? A:78 you can use LOAD DATA INFILE file_name; syntax to load data from a text file. but you have to make sure thata) data is delimited b) columns and data matched correctly Q:79 How can we know the number of days between two given dates using MySQL? A:79 SELEC T DATEDIFF(2007-03-07,2005-01-01); Q:80 How can we know the number of days between two given dates using PHP? A:80 $date1 = date(Y-m-d); $date2 = 2006-08-15; $days = (strtotime($date1) strtotime($date2)) / (60 * 60 * 24);

This page has the following sub pages. PHP-MySQL Interview Questions 2 191 Comments

191 Responses

1. on March 21, 2007 at 9:47 am | Reply A tremendous work. very useful indeed.

hasin

Amazing. I will add some question and answer in this post very soon. Keep up good work, Mizan.

2. on March 21, 2007 at 10:14 am | Reply

Rakibul Islam

I was looking for this kind of interview questions ans answers. Nice work man. This kind of post will help us very much. I am waiting for full, i mean all 200 quetions and some extra questions from Hasin Vi and fom others. Keep it up. Rakib Programmer/Web Developer

Programmer/Web Developer http://www.systechdigital.com

3. on March 22, 2007 at 5:58 pm | Reply

Ahsan

Nice one Mizan Bhai. I will surely go through the list.

4. on March 26, 2007 at 6:30 am | Reply # What is float property in CSS? # What is descendent structure in CSS? # What is Child Descendent structure in CSS? # How to create a class in JavaScript? # Are namespaces are there in JavaScript?

Rakibul Islam

# What is JSON? What are the notations used in JSON? # How you provide security for PHP application? # How to get Query String in PHP for http request? # How to get the http Request in PHP? # What is SQL Injection in PHP security? # What is cross site Scripting? - Rakib - rakibulislam.wordpress.com

5. on April 10, 2007 at 6:07 am | Reply Hi Mizan,

Asit Katiyar

Your collection of questions is really very good and valuable. I am also working on opensource projects and try to share my knowledge about PHP in my blog. I you get time please visit this also, http://asitkatiyar.wordpress.com/

Asit

6. on April 23, 2007 at 5:17 am | Reply

gaurav gupta

Hi asit, I have recieved ur php quetion and answer, realy it will be benificial for me in my php job,I request u that update ur qustion and answer with good example, i hope that oncentrate at this my point. Thanks Gaurav Gupta Delhi

7. on April 23, 2007 at 5:40 pm | Reply Hi,

Jaiprakash

Really good works. It would definitely beneficial for all the guy. Many many thanks. Jaiprakash

8. on May 1, 2007 at 5:33 pm | Reply Hi there,

Kenan KARA

im happy to meet you with this perfect paper, i try to translate these mysql tips to my own site java.name.tr mysql and php are the most popular development scripting language and db so that these papers are popular in my country, too. Thanks, Kenan KARA

9. on May 30, 2007 at 2:33 pm | Reply Super tips its really very helpfull

Arun

Super tips its really very helpfull

10. on June 11, 2007 at 11:35 am | Reply Hi,

bharathi

Really good works. It would useful for all the guy who are all interested in php. Many many thanks. bharathi

11. on June 15, 2007 at 8:29 am | Reply Hi there,

Sarav

You are great , to get perfect answers above, very useful for the one who is going for php interview

12. on June 25, 2007 at 8:49 am | Reply Hi, Great Work,Thanks for u. This will be very helpful to me. Continue this work.

Mervin Thomas

13. on June 27, 2007 at 3:41 pm | Reply

Jayant Patil

SQL Injection Is Good or Bad to use in coding? Explain right way to use it? If bad, how to prevent it from getting misuse?

14. on July 4, 2007 at 5:22 am | Reply Hi Mizan,

Parth Painuly(India)

Hope you are fine.. u have done a good work! sorry but there is a slight correction required in question no. 4

sorry but there is a slight correction required in question no. 4 Q:4 In how many ways we can retrieve the date in the result set of MySQL using PHP? it should be data not date. rest the questions are really great.. catch u some day. Thanks & Regards Parth

15. on July 6, 2007 at 5:36 am | Reply

Pooja

Hello, Thanks u. This will be very helpful to me. Tomorrow is my interview and i have gone through this section,lets see the result. Thanks Pooja.

16. on July 13, 2007 at 8:57 am | Reply

Amjith PS

17. on July 26, 2007 at 5:46 pm | Reply

Joshua Giese

Thanks you for this post, its a great resource. Its great for interview questions to ask. Its also a good quiz to take to test yourself.

18. on July 27, 2007 at 4:20 am | Reply

naveen

How can you rate CSS types like (embedded,inline,external) while using and which type will get 1st proiority why?

19. on August 3, 2007 at 1:30 pm | Reply Thank u very much,Excellent q-a.

amol savat

20. on August 3, 2007 at 1:34 pm | Reply Hi Mizan, This is

laura_Choot

21. on August 6, 2007 at 9:07 am | Reply Hi Thanks for your help. Amazing Job. Gaurav

Gaurav Sharma

22. on August 7, 2007 at 11:46 am | Reply

Srinivasan

Thanks a lot, Its very useful to get details about the various small concepts in depth

23. on August 8, 2007 at 5:17 am | Reply

Prabakar

Thanks u. This will be very helpful to me. Tomorrow is my interview and i have gone through this section,lets see the result.

24. on August 8, 2007 at 5:39 am | Reply Hello Mizanur Rahman,

Syed Ahamed

Hello Mizanur Rahman, Asalamu Alaikum, I am from Tamil Nadu. I am working as a web developer in a small Web Development Company. I want to improve my PHP and Mysql Knowledge and as well as My Communication Skills. Please Provide some instructions to me to become a Good PHP Programmer. Thanking you, Thanks with Regards, B. SYED AHAMED

25. on August 8, 2007 at 5:32 pm | Reply Hi Syed

booleandreams

Thanks for your comment. In order to improve your PHP and MySQL knowledge always keep you updated with the current progress of these two most popular platform. You can read professional PHP 5 from wrox publication or even PHP power programming for a solid understanding of PHP Object Oriented Programming. You can study a good RDBMS book to understand how SQL works specially how to make your database optimized and operation faster. For your communication skill you can always talk with other people to increase your speaking and listening capability. for writing, start blogging take care and drop me a line if you need anything regards Mizan

26. on August 16, 2007 at 7:58 am | Reply Hi, Great Work Mizanur Rahman.

Shankhar

Im Shankhar working in a Web Development Company in Chennai. Your tip helped me a lot. Thank you very much, Thanks for sharing, Shankhar

27. on August 17, 2007 at 4:20 am | Reply

Rimmi

Hi All, i need some help on making a file or image downloadable. and also want to know a lot about cookies.. Help me on these topics Waiting for reply.. Thank you

28. on August 28, 2007 at 5:53 am | Reply Hi

Chaitanya

This is really very helpful only on PHP, but i think it did not cover most of the topics of MySQL like why Joins are efficient than Subqueries?,etc.. Can you please add questions related to MySQL also in place?

29. on September 13, 2007 at 10:43 am | Reply hello, to every one this all questions helps me lot. thanks a lot to all of u.

Deepali

30. on September 18, 2007 at 2:35 am | Reply Hi all! Very interesting information! Thanks! Bye

hiutopor

31. on October 17, 2007 at 11:51 am | Reply

Javed

what is the difference between $$ and $? Give a example of $$ .

32. on October 17, 2007 at 12:01 pm | Reply hi Javed in PHP $ sign is used to indicate variable $$ is used to indicate Variable variables

booleandreams

now what does a Variable variables means. here is an example $name = mizan; // a simple php variable now can you tell me what does the following line mean? $$name = $name; well its pretty simple, it will just replace $name with mizan so $mizan = mizan; if i echo $mizan then i will get the desired value. so we are creating dynamic variables during run time. you must have a question , what is the application of such variable? in many situation we need to create variables dynamically and do operation with them. this is ideal on such situation. i hope it answers your question.

33. on October 18, 2007 at 4:18 am | Reply Thanks Mizan Vai for ur nice solution.

Javed

34. on October 18, 2007 at 5:04 am | Reply

Javed

Between php and java which one is most preferable and why?what are the differences between them?

35. on October 22, 2007 at 5:44 am | Reply

junal

A great collections of all needy answers about PHP. thank you mizan bhai.

36. on October 29, 2007 at 3:13 pm | Reply

Devasundaram

Fantastic! Each and every questions (with answers) make brightness of our future. Well done Mizanur Rahman. Keep adding this. Thank you, once again

37. on November 1, 2007 at 6:11 am | Reply this is really a great keep adding this thanks

sandeep

38. on November 6, 2007 at 9:29 am | Reply This was very very usefull for me thanks u lot

Dillip

39. on November 21, 2007 at 7:05 am | Reply

Atul Pandey

Its a excellent information about PHP interview question. thnx

40. on November 25, 2007 at 9:36 am | Reply

Megha

The above questions are very good and helpful, please provide me some more questions like this, Im prepairing fro my PHP and My SQL interviews. Thanks, Megha

41. on November 26, 2007 at 7:49 am | Reply Good work dude ! Was looking for exactly this.

Baba

Good work dude ! Was looking for exactly this. Thanks !

42. on November 27, 2007 at 6:36 pm | Reply Hi Mizan

sainath

Your content is really helpful and really looking like this info regarding FAQs. I need a Suggestion from you. I was working as a Designer and now learned PHP 4.0 just a month ago. Now trying for a Opportunity in PHP. What kind of stuff i should be in perfect to get a nice job. Regards Sainath

43. on November 28, 2007 at 11:10 am | Reply hi now i am working in php very use full for your tips. by jeyasankar.a

jeyasankar

44. on December 12, 2007 at 11:26 am | Reply

Nadeem

Thanks man for all that info. Actually a great collections of answers to the general PHP questions

45. on December 14, 2007 at 1:06 pm | Reply

Dillip

Hi all, thankx for share all problem with us pls update ur problem because we can improve our knowleg.

46. on December 22, 2007 at 12:54 pm | Reply

Neeraj

I was looking such kind of interview question and answer

ohh really its very use full for us Amazing and appreciable thanx Mizanur Go ahead

47. on December 27, 2007 at 5:36 pm | Reply Dear Good Post, I am satisfied, waiting for full version

Robin

48. on January 3, 2008 at 10:47 am | Reply A:61 describe Table-Name; explain Table-Name;

mysql356

49. on January 17, 2008 at 11:26 am | Reply

Narendra

I read given questions and answers i like it, it is very help full for a new comer or experience programmer in php . Currently i am working in http://www.applelounge.com is web development company in New Delhi so i think it is help full for everyone. Thanks & Regards, Naren Samant

50. on January 17, 2008 at 12:57 pm | Reply hello

imran

51. on February 8, 2008 at 5:02 am | Reply Gret job dude , the content was different and really useful

SamJacob

the content was different and really useful thanks!

52. on March 8, 2008 at 2:26 pm | Reply Thanks buddy!

Shahzad Akhtar

I am going for a PHP interview tomorrow and its really helpful. Please also do same kind of work for some other languages also, like VB, VC, Java, etc., if possible!! Thanks again, Shahzad

53. on March 13, 2008 at 6:22 pm | Reply thanks..

Nurul

54. on March 15, 2008 at 6:25 am | Reply

Jane

55. on March 15, 2008 at 10:51 am | Reply

Halo

56. on March 18, 2008 at 3:16 am | Reply Q. How can we sort multidimension array?

ashish dwivedi

57. on March 26, 2008 at 10:51 am | Reply hi,

umesh yadav

i am umesh yadav, i was searching for php interview study material. thanx a lot for above. regards. umesh yadav

58. on April 3, 2008 at 6:32 pm | Reply

Rahul Kumar

Hello, This php-mysql-interview-question is very useful for interview as well as it also increase knowledge, very very thanks.

59. on April 7, 2008 at 5:49 am | Reply

Athar Mustafa

Thanks for the collection published. Mizan I just want to know what are the certification a person can do in php and what are the benifits of doing that in job regard. If you know please tell me the books so that i can start.

60. on April 15, 2008 at 1:37 pm | Reply

suman

Hi, Its a greate set of INTERVIEW QUESTION & ANSWER in PHP but I need more questions and answer in session and cookies.

61. on April 15, 2008 at 1:39 pm | Reply thanks..

suman

62. on April 16, 2008 at 2:39 pm | Reply Simply Great

waseem

63. on April 18, 2008 at 2:25 am | Reply Awesome job!!! Really usefull stuff

Sree

64. on April 19, 2008 at 6:02 am | Reply

Athar

I just want to know about the certifcation program in Mysql. Please if any body knows about it please help me. Thanks in advance A.Mustafa

65. on April 20, 2008 at 3:20 pm | Reply Hi

Ganesh

It is very useful for php programmers, write now i am studying php, could u help me the programming logic for php, my friends are saying to study dotnet, but i am interest in PHP. Future for PHP????????? Please advise me as soon as possible. Thanks Ganesh.B

66. on April 22, 2008 at 12:21 pm | Reply

prahlad

great job, it very helpfull for every one. keep it up

67. on May 6, 2008 at 7:34 am | Reply

gautam

amazing work,really very helpful to use for the interview.You should place some example of php which is given a typical ans.like print $a=12==123; put some melodious and brain storming exaples in php.But nice work

68. on May 6, 2008 at 8:19 am | Reply

Aaron

Great start! I think it could use some grammar checking, and a little bit of updating but overall I think its great!

69. on May 6, 2008 at 10:23 am | Reply Greate i like it thanks

romharshan

70. on May 7, 2008 at 5:38 am | Reply Hi It is very useful posting and great work.

sudandira

i searched for few PHP questions for selecting candidates by written test but i got very few questions from other sources. Your posting is very useful for me. thanks Regards sudandira

71. on May 9, 2008 at 9:21 am | Reply

Javeed

Hii It is Very Nice to see all your interview questions. I have a Quick Question currently am working as a web Designer from past 1 yearBut am interested in Java Development.. what should i Do? it is good to be web Development or shall i jump into java development

72. on May 13, 2008 at 6:48 pm | Reply

vijay

this is really usefull for interview thanks a lot for posting all this. Thanks, Vijay Kandoria

73. on June 2, 2008 at 11:23 am | Reply Thanks ..

Umn

74. on June 7, 2008 at 5:03 pm | Reply

Sathish Kumar

Hi Rahman, Youre interview questions are really superb. I get some knowledge after i go through all the questions posted above. There are some other questions asked by an interviewer in a company. They are 1.What is DDL and DML? 2. Difference between copy and move_uploaded_file 3. How to swap a value without using a third variable? 4. Which function is used to send attachment in mail? 5. Which table in mysql is used for transaction process? Cheers, Sathish Kumar.R

75. on June 12, 2008 at 7:43 am | Reply

fawwad Ali Khan

I am also a PHP programmer from india .Your Forum is very good for those student or person wants to start career as a php developer.Nice and thanks Fawwad Ali Khan

76. on June 20, 2008 at 7:36 am | Reply Helo Sir, Realy your questions are good. Thanks. Bagyaraj Sekar.

Bagyaraj Sekar

77. on June 20, 2008 at 10:21 am | Reply

jeyasankar

77. on June 20, 2008 at 10:21 am | Reply

jeyasankar

hi I am jeyasankar php developer and web developer from chennai. I am a Software Engineer by profession. I love to work on open source projects and specially web based systems. I am a moderator of the PHPExperts, the largest PHP Users group in india and chennai. so any query ask me my mail id ,i will send replay.

78. on June 20, 2008 at 10:22 am | Reply

jeyasankar.A

I am jeyasankar php developer and web developer from chennai. I am a Software Engineer by profession. I love to work on open source projects and specially web based systems. I am a moderator of the PHPExperts, the largest PHP Users group in india and chennai. i am experts in this area of all type server and SEO and cms.

79. on June 20, 2008 at 2:40 pm | Reply

Manoj

Thanks for the perfect answers for those questions. it helped me interviews. please add more questions from http://www.geekinterview.com/Interview-Questions/Programming/PHP in the above, site job seekers ask their questions but dont get right(perfect) answers . please try to answer those questions in this site. Thanks again( Iam not so good in English to express my feelings).

80. on June 24, 2008 at 8:29 am | Reply HI Its very useful Thank you

ashok

81. on June 28, 2008 at 2:02 pm | Reply

kapil r

I must say dats a wonderful compilation of exhaustive question on php & mysql too .. i will help u , if i can add more question & answer to it..

add more question & answer to it.. n i wud just ask u 2 give answers with some examples as far as possible..coz its much better way to explain any point. thnks a lot

82. on July 2, 2008 at 7:07 am | Reply

Priti

Really, Its very helpful and a straight forward answer.It helps a lot for the interview guys.

83. on July 3, 2008 at 4:00 pm | Reply Hi Brother Assalamu alaikum

Musammil

i am mohamed musammil,this makes a very helpful to our php Guys.also i need the tutorial and Sample Programs realted to Cake PHP Framework. Thanks & regards Musammil

84. on July 23, 2008 at 8:49 am | Reply Hey Man u have done a greate task here Nice Nice Very Nice Simply Great Thanks & Regards, Jatin

Jatin

85. on August 4, 2008 at 10:51 am | Reply Thanks,

Md. Iftekhar Hossain

Very useful and helpful..

86. on August 4, 2008 at 5:47 pm | Reply

charu verma

cool dude! keep it up, well done! all the very best for everything!!

87. on August 8, 2008 at 2:39 pm | Reply good questions and answers . its very usefull.

Goli.Nagaraju

88. on August 21, 2008 at 8:04 pm | Reply Its really impressive and helpful stuff

Pritam

89. on August 29, 2008 at 2:44 pm | Reply

Abhishek

Your All information are good!Thanks For Creation. I Want to Achive A good Knowledge Of PHP. Please Give Me some tipes for it. YOUR WELL WISHERS.. ABHISHEK ANAND.

90. on September 4, 2008 at 6:17 am | Reply Hi, This is Ruchi. First of all thanks this is a nice set of question. i write some more question here. 1-Tell me five function which are related to string. 2-how i upload a file.

Ruchi

2-how i upload a file. 3-find out the 2nd highest record of the table.

91. on September 4, 2008 at 10:41 am | Reply

Suman Kumar Sinha

HI All, This site is tremendous. This is very useful for me and for all who are interested in PHP. Good Work.

92. on September 4, 2008 at 11:16 am | Reply Hi Ruchi, 1. Five Functions related to string are:a) trim() b) substr() c) strstr() d) str_replace() e) stristr()

Suman Kumar Sinha

2. $photo_folder=upload_images\; $path_Im=pathinfo($_FILES['image_name']['name']); if($path_Im['extension'] ==jpg) { $img_name=image..$path_Im['extension']; move_uploaded_file($_FILES['image_name']['tmp_name'],$photo_folder.$img_name); 3. $query = SELECT * FROM `table_name` ORDER BY field_name` DESC LIMIT 1 , 1 ;

93. on September 5, 2008 at 9:25 am | Reply Thanks Suman,

ruchi

but in the answer of third question u write a query but this query give me last record. But i want to find out the secend last record. or one more question How i find the nth record from a given table

94. on September 6, 2008 at 6:26 am | Reply thats fine

vinayak

95. on September 8, 2008 at 4:09 pm | Reply

Abu Faisal Ahmed

How can I make a script that can be bi-language (supports English, German)? I want to know about this feature more. if you suggest me with an example that will be much helpful for me. Any web link will works fine. thnx.

96. on September 13, 2008 at 11:07 pm | Reply Thanx a lot. It really helpful.

Zahid

97. on September 18, 2008 at 7:33 am | Reply

samik chakraborty

Very useful question and answers .I always follow this site before I interviewed. but I expect more class oriented question and answers from booleandreams.

98. on October 1, 2008 at 9:14 am | Reply Hiiieeyyyy,

Priyank Sharma

how we can control the .httpds file with using .htaccess For permit the Mod Redirect permissions. Thanks Priyank Sharma (+91)-9928566520

99. on October 12, 2008 at 12:37 pm | Reply I have only one word for you.

SACHIN

FANTASTIC ALL THESE QUESTIONS ARE IN http://www.phptalk.com/index.php?page=details&id=12 AND I GOT ALL ANS HERE.

100. on October 12, 2008 at 2:32 pm | Reply thanks for the post.

simon

101. on October 22, 2008 at 9:53 am | Reply

Gursewak

Yes really very good help.But i need help cakephp and Zend framework.Waiting ur reply

102. on November 4, 2008 at 11:41 am | Reply Hi, All of the Question`s are good. Thanks

AMKVERMA

103. on November 17, 2008 at 6:00 am | Reply Hi Mizanur Rahman,

Shishir

Yesterday i faced an interview for the post of Php Developer in my city, i gave the interview and got selected just because of few questions which others didnt knew like max size of sqldb, $$message, how to transfer one db table to another etc. . I want to say you THANK YOU. Without ur this contribution i was unable to crack that interview.

was unable to crack that interview. Hats Off to you Mizan. Cheers

104. on December 4, 2008 at 6:08 am | Reply

machine

this is not a good job to copy and paste this question from another website. try to do yourself what you can.

105. on December 4, 2008 at 7:06 am | Reply

mizan

Mr. Machine, thanks for your response. but please read the first paragraph of this page, it clearly says these questions are taken from different site and compiled to a single place. I am not taking credit by saying that its all mine. I hope that clears your misunderstanding. cheers.

106. on December 6, 2008 at 9:31 am | Reply

machine

hmmm. i like you guys and i also know you. you r good developer as well.

107. on December 8, 2008 at 11:55 am | Reply

Harsh Gaur

Thanks Sir your question and answers are very good and very helpful for me and all many people But can you give me like some mysql_query relative questions like.. E.G.how to fined higest salary, lowest salary , second highest salary, left join , right join, inner join. etc. because this questions is very imp. for interviews Thanks and Regards Harsh Gaur harshgaur21@gmail.com

108. on December 9, 2008 at 6:53 am | Reply

pawan sharma

these question are very helpful for me. i have selected in many company. i have read only these question. very very thanks Pawan Sharma

109. on December 16, 2008 at 5:11 pm | Reply

Sameer Chourasia

I m also face all the questions in one company technical written test round and i face plenty of them correct but some of them are also added now from my side which i faced now are as follows Q-1. What is the Javascript type? Ans- For JavaScript, use type=text/javascript. Q-2 What is the advantage and Disadvantage of MySql and PHP? Q-3 When we used @ symbol in php?

110. on December 17, 2008 at 3:56 am | Reply

Vani

Very helpful. Goodjob!!. Thanks for all the hardwork.

111. on January 6, 2009 at 7:34 am | Reply AssamAlaikum bhai. Good job,Its great !!! thank u

mohasin tamboli

112. on January 8, 2009 at 2:09 pm | Reply

vijayan

Thanks i think it help me to lot, u said ur working in open source i need interview questions from open source if possible please help me

113. on January 13, 2009 at 5:57 am | Reply

hiren

113. on January 13, 2009 at 5:57 am | Reply

hiren

Thanks Sir your question and answers are very good and very helpful for me and all many people But can you give me like some mysql_query relative questions like.. E.G.how to fined higest salary, lowest salary , second highest salary, left join , right join, inner join. etc. because this questions is very imp. for interviews Thanks and Regards Hiren Patel

114. on January 19, 2009 at 5:24 pm | Reply hello sir,

anu mittal

I was looking for this kind of interview questions ans answers. Nice work sir. I read given questions and answers i like it, it is very help full for a new comer or experience programmer in php . now i m able to face interview.these ques r very cutial for me bcoz on 23 ill face a interview. thanks a lot sir..

115. on February 2, 2009 at 10:34 am | Reply

Jaydeep Dave

I read the questions and answers and I get good and positive results in job. These questions and answers really helpful for interviews.

116. on February 7, 2009 at 3:36 am | Reply

Santosh

Given Question Answer are really helpfull i liked it.. most importantantly itw way of presentin question answer

117. on February 18, 2009 at 12:47 pm | Reply i have find all type of Q. in this site, but some Q not pls send this ans.

jayesh

but some Q not pls send this ans. thank u 1>can i fire triger in multiple table? 2>what diffrent type of payment getway? 3>how to find server when user login and logout?

118. on February 26, 2009 at 8:19 am | Reply

neena

hello sir thanks alot for such kind of good questions. sir please answer me how we can retrieve the value from data base in login page and restrict the user name password

119. on March 18, 2009 at 5:18 am | Reply This is very much helpful. Thanks

sakilcse

120. on March 20, 2009 at 4:55 am | Reply hi

jeyasankar.a

all php developer very useful all tips,if any php or mysql issuse plaese send me your issuse i willl send good solutions. regards jeyasankar.a

121. on March 25, 2009 at 5:16 am | Reply Great work. Want more of this type of question. Keep it up Regads, Hetal Sagar.

Hetal Sagar

122. on March 26, 2009 at 1:48 pm | Reply

SenG

Rahman, Greets for your hardwork. If I have seen this before getting into interview id have got placed. I posting some PHP question which I have asked by my interviewer to reject me. Would you mind, if I tell u to check ur spelling in your posts? What is output buffering? What is register globals and why it is unsecure? If particular server is accessed by many, whether would be created for all? mysqlconnect vs mysqlpconnect ? difference between explode and join methods()? Given SQL table with data in one column, Red 10 times, Green 7 times, Blue 5 times, White 3 times, write the query to sort the elements so that the element with maximum no. of occurrence will come first and so on. (In our case it should be same order as Ive written the elements) Who will display a table of contents in alternate back color Who will you show/hide particular table How will u refresh particular section of webpage without affecting others

123. on March 26, 2009 at 2:02 pm | Reply

kushal

hi this is really excellent tips for me. and this will benifit to my interview. so pls update a qustion and answer. pls send me question and ans on mail. about java,php and mysql. i really thankful to u. kushal

124. on April 1, 2009 at 12:27 pm | Reply Hi,

Sudharshan

This is very useful to me, So am very very happy to looking through this site. With Warm Regards Sudharshan Reddy

Sudharshan Reddy

125. on April 2, 2009 at 3:05 am | Reply Nice job.

Kev

Some answers are not correct. For example, defining varchar in Mysql as varchar(10), then inserting mysql will take 6 bytes instead of 5. Database normalization has 7 forms instead of 5. I dont know if PHP faster than JSP or not, since JSP needs to be complied into servlets first, but definitely PHP is slower than JAVA.

126. on April 2, 2009 at 4:46 am | Reply Hi Kev

mizan

what makes you think PHP is slower than Java?

127. on April 2, 2009 at 7:56 pm | Reply

Kev

Java is complied, PHP is interpreted. Even if the recent PHP can be complied into Opcode, it is still slower than Java. Google it and you will see that.

128. on April 3, 2009 at 2:07 am | Reply Hi Kev

mizan

thanks on focusing on this. the issue reveals in which aspect php is slower than Java. and the thing you just found, i have faced the issue 3 years back while i was building a large VOIP billing software. PHP File IO is very slow and slowest of all the available programming language. So i think that is one point where we should not use PHP, i personally prefer Perl or Python for file IO. I think you also know the fact that Java IO was painfully slower and then they had to come up with new implementation of IO known as NIO. so lets see if PHP comes up with something cool and new in future. thanks Mizan

129. on April 14, 2009 at 1:06 pm | Reply Hi, Thanks a lot. Very nice Questions.

Gagan

130. on May 6, 2009 at 5:28 am | Reply hey rahman,

shivaganesh

many thanks to u for bunch of questions and answers

131. on May 12, 2009 at 4:29 am | Reply

Osman

JAZAAK ALLAH. MAY ALLAH BLESS ALL WITH THE BEST

132. on May 15, 2009 at 10:08 am | Reply hi,

deep

its too good and nice.it helps up to resolve some basic PHP fundamental questions, which we perhaps miss in our basic training.

133. on May 21, 2009 at 11:33 am | Reply nice jobs dear.

gaurav

134. on May 30, 2009 at 5:55 am | Reply

Palani

Hi , This is Palani.K form india , first i want say thanks for hard work to prepare this interview questions , its very useful to every one. how to focus on interview .

thanks & regards Palani.K

135. on June 9, 2009 at 10:20 am | Reply [...] PHP-MYSQL interview questions [...]

ayeshaSilvias Blog

136. on June 10, 2009 at 6:28 am | Reply Thanks a lot Mizan Bhai This is really excellent work.

Zaman

137. on June 11, 2009 at 10:06 am | Reply Greate work!..

Pradeep Narayanan

138. on June 25, 2009 at 3:14 pm | Reply really good workexlnt

Maqsood Ahmad

139. on June 28, 2009 at 8:44 am | Reply hello,

ishtiaque sarwar

how to add paypal for any website which has any product to sell to the interested buyer using php mysql. it would be a great help if u can assist. thanks

140. on July 3, 2009 at 5:53 am | Reply Hello,

Kantilal

Hello, I want to show a little mistake in this page. Give before span of Q.73 all other tips are very useful. Thanks.

141. on July 10, 2009 at 6:24 am | Reply

Superchunk

Hmm theres a good book too if you want to learn more about php http://www.dealsshoppie.com/product/search.php? ID=0470096004&product=PHP+%26amp%3B+MySQL+For+Dummies

142. on July 14, 2009 at 7:06 am | Reply Hello, Really lovely work, Great Job. Very Thanks Yogendra Kaushik

Yogendra

143. on July 31, 2009 at 3:06 pm | Reply Hello Mizanur, Thanks buddyreally helpful

Vishal

if you aware about other good que-answers in pdf format plz give the linkanyother know plz share thanks.

144. on August 2, 2009 at 7:20 am | Reply Hi, Thanks Its really very helpful

rakhi

145. on August 5, 2009 at 7:03 pm | Reply

Smitha Anil

HeloThank you.it help more than my expectations. i can get more idea & knowledge through it.

146. on August 18, 2009 at 7:21 am | Reply

rose

Hi, I need to store and retrieve Other indian languages(Tamil with English) in phpMySQL

147. on August 18, 2009 at 10:56 am | Reply very nice source for php & mysql developer

Rina

148. on August 20, 2009 at 1:07 pm | Reply realy interestibng and helpful thanks

Vasanthan

149. on August 26, 2009 at 9:41 pm | Reply

Ilyas

Hi Guys! Thanks for questions nd all comments, these are really very helpful. I appreciate keep it up

150. on August 31, 2009 at 12:43 pm | Reply

swathi

Hi it was really helpful and got an idea what how the questions will be. Thanks alot.

151. on August 31, 2009 at 12:53 pm | Reply How many tables mysql database can have?

swathi

152. on August 31, 2009 at 7:19 pm | Reply thank u.. it was really helpful.. great work

Deepthi

153. on September 29, 2009 at 1:50 am | Reply

Muskan

Thanks a lot.its a very very helpful one.i really came to know lots of basic things from this.excellent job.

154. on September 29, 2009 at 11:47 am | Reply thanks you. it is very helping to clear concept.

shubhangi kakade

155. on October 6, 2009 at 11:29 am | Reply What can i say Great Work Thank U Mizanur

Anand

156. on October 6, 2009 at 12:36 pm | Reply thanks for really perfect article i ever seen.

Syed Zafar Ali Shah

157. on October 18, 2009 at 4:02 pm | Reply Hi Mizanur Rahman, Its a amazing article for php developers Thankz, A.Mubarak Ali.

mubarak

158. on November 5, 2009 at 5:07 am | Reply hi.. great work dude.. thanx.

rafi

159. on November 7, 2009 at 11:09 pm | Reply

PRINCE

THANK YOU VERY MUCH.YOU HAVE DONE A GREAT WORK.

160. on November 10, 2009 at 5:13 pm | Reply thanks. very nice source for php & mysql developer

manoj bhardwaj

161. on November 16, 2009 at 4:07 pm | Reply

sachith

greate work man/// thanks a lot do it more for us can you tell me that what is the easy way to learn about XML?

162. on November 30, 2009 at 6:30 am | Reply Great work bro, really helpful Thanks!

Sara

163. on December 6, 2009 at 3:34 pm | Reply hi mizan, really good job.

naresh kumar bhambhu

really good job. put some more practical senario questions such as 1) does php support application context. ans: yes you have to manage it through cookies. 2) how you will manage cookies at application level ans: while setting cookies set cookie path to application level 3)can we use session_register and cookie setting after html start tags. ans: no, have to use them before html start tag.

164. on December 16, 2009 at 1:49 am | Reply

Sonali

Nice collection of Questions.This will be vry Helpful for us.

165. on December 16, 2009 at 1:51 am | Reply

Sonali

All questions are gr8, but I want you to put some practical and logical questions more on php and Mysql..

166. on December 18, 2009 at 6:41 pm | Reply PHP interview questions , Part 2 | Webby Info [...] osted some detailed answers on his blog. [...]

167. on December 28, 2009 at 6:07 am | Reply very nice & useful for referring php info

munny

168. on January 6, 2010 at 3:09 pm | Reply Hey dude

mayur

Your questions and answers are really helpful to the ppl like me who wish to make a career as a PHP programmer. Very Helpfull. Million thanks to you.

Million thanks to you.

169. on January 6, 2010 at 8:29 pm | Reply

yoftahie

This is one of the best collection of question and answer about php. Thanks for your great work

170. on January 13, 2010 at 5:50 pm | Reply

Kiran

Thanks man , who have posted all these valuable questions and their respective answers. its really a wonderful job. U better to create a blog and it will be much rated. Good bye.

171. on January 26, 2010 at 4:49 pm | Reply

mywebin

excellent work i really appreciate the guy who collect this stuff!

172. on January 30, 2010 at 11:31 am | Reply Total 5 types of tables we can create 1. MyISAM 2. Heap 3. Merge 4. INNO DB 5. ISAM

patel axay

173. on January 30, 2010 at 11:33 am | Reply

patel axay

very nice way to prepare yourself a php and mysql for the interview.

174. on February 3, 2010 at 9:22 am | Reply Hi,

Sreeraj

Hi, Tremendous work.. I got a lot of new information keep this.thanks.

175. on February 4, 2010 at 7:51 am | Reply

Priyanka Rao

hi, your questions are really helpful.i just want some help in smarty.so can u plz publish some interview question on smarty also.

176. on February 6, 2010 at 7:40 am | Reply

devrshi

u have done greate job dude. and u have a greate collection of questions, which realy help full for the interview.. thanks.

177. on February 9, 2010 at 9:38 am | Reply

ENGR:ZAKIR ALI

JAZAK-ALLAH hello sir thanks alot for such kind of good questions. who will be help full to every one who is beginner to give interviews.

178. on February 11, 2010 at 11:46 am | Reply Very Helpful question for Interview Thanks

Yogesh Han

179. on February 23, 2010 at 2:33 pm | Reply

sunita

Hi, i am sunita i have just completed my PHP,i m getting some problem regarding this,actually i have installed

i am sunita i have just completed my PHP,i m getting some problem regarding this,actually i have installed the software properly but still i m unable to create my database pls tell me the solun regarding this

180. on March 7, 2010 at 1:03 pm | Reply

sunny

Your answer to question 16 contradicts itself. You say that nl2br() inserts before newlines, but then you say that echo nl2br(god bless\n you) will output god bless you. The output will, in fact, be god bless\n you.

181. on March 7, 2010 at 1:08 pm | Reply

sunny

My comment (concerning nl2br) was not rendered on the page as I intended. The last sentence was meant to show the break tags. Ill try this: you say that echo nl2br(god bless\n you) will output god [break tag] bless you. The output will, in fact, be god bless[break tag]\n you.

on March 7, 2010 at 10:02 pm | Reply Hi Sunny

booleandreams

I think you are doing something wrong here. i think my answer is right. can you please read it carefully. i said the break will be after bless and there will be no \n once nl2br is run. so i do not know where you are getting this answer. if you write the expression in a single quote then the result will be completely different. try out by yourself thanks for stopping by

182. on March 14, 2010 at 6:14 pm | Reply

amin

Hi Im looking for a way to encrypt data. these are the steps: 1) User login to the website. 2) ask to download a file from Mysql database. 3) The system encrypt the file using user (email,passphrase). 4) The user collect the encrypted file. 5) Then decrypt the file using (email,passphrase).

5) Then decrypt the file using (email,passphrase). 6) Using any programming laguange compatible with PHP

183. on March 14, 2010 at 6:33 pm | Reply good work, thank a lot

184. on March 17, 2010 at 8:12 am | Reply this is very help ful to me

raza

185. on March 21, 2010 at 2:19 pm | Reply Hi all, Thanks Mizan, its a very useful kit for me. My question is

Sunil Kumar

whats tag that are supported by both IE and Netscape. Sunil Chandigarh(India)

186. on March 30, 2010 at 6:21 am | Reply

dexpress

i m getting some problem regarding this,actually i have installed the software properly but still i m unable to create my database pls tell me the solun regarding this

187. on March 30, 2010 at 6:22 am | Reply

webmaster

i m unable to create my database pls tell me the solun regarding this

188. on March 30, 2010 at 6:24 am | Reply

aadi

i do not know where you are getting this answer. if you write the expression in a single quote then the result will be completely different. try out by yourself

189. on March 30, 2010 at 6:26 am | Reply

webmaster

Your questions and answers are really helpful to the ppl like me who wish to make a career as a PHP programmer. if you aware about other good que-answers in pdf format plz give the linkanyother know plz share

190. on April 2, 2010 at 12:35 pm | Reply I m getting some problem in button event. How can i attach an event on button.

aka

Comments RSS

Leave a Reply

Guest

Notify me of follow-up comments via email. Notify me of new posts via email.

Notify me of new posts via email.

About Me

I am Mizanur Rahman from Bangladesh. I am a Software Engineer by profession. I love to work on open source projects and specially web based systems. I am a moderator of the PHPExperts, the largest PHP Users group in Bangladesh.

My Books
MediaWiki Administrators Tutorial Guide

MediaWiki 1.1 Beginner's Guide

My Certifications

Search

Pages

About My Resume Certification PHP-MySQL Interview Question PHP-MySQL Interview Questions 2 Plugins

c
Select Category

Archives
February 2009 August 2008 July 2008 March 2008 November 2007 October 2007 August 2007 July 2007 June 2007 April 2007 March 2007 February 2007 January 2007

My Family

More Photos

Blog Stats
190,602 hits

Recent Posts
My Personal Site www.mizanurrahman.com Ask PHP/MySQL/Javascript/Web questions!!! Atlast our dream project has started!!! How to SWAP values of two variables without using a third variable (integer) ? PHP ini issues for scripts running in CLI or executing shell_exec() in *nix

Category Cloud
Bangla Tech

Code Igniter

Database

Me MediaWiki MYSQL

New

Packt Publishing

PHP Uncategorized Web Wordpress

Meta
Register Log in Entries RSS Comments RSS WordPress.com

Top Posts
PHP-MySQL Interview Question How to SWAP values of two variables without using a third variable (integer) ? Why to use Stored Procedure or Prepared Statement? Code Igniter: Installation and First Run Installing CodeIgniter on IIS Running multiple instance of MediaWiki on the Same Server using the Same Source Code? PHP-MySQL Interview Questions - 2 A nice example of mediawiki - www.wikihow.com Running CodeIgniter from Cron/CLI New Sorting Feature for MediaWiki Table Blog at WordPress.com. Theme: MistyLook by Sadish.

Vous aimerez peut-être aussi