Tuesday, July 15, 2008

PHP-Mysql Interview Questions

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).

In how many ways we can retrieve the data in the result set of MySQL using PHP?

You can do it by 4 Ways
1. 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?

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 PHP’s 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?


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 handlefailure. include() produces a Warning while require() results in a Fatal Error. In other words, use require() if you want a missingfile 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 differencebeing 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 particularexecution 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.
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.

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

Yes we can use include() more than one time in any page though it is not a very good practice.

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)) ?

Total 5 types of tables we can create
2. Heap
3. Merge

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.

How can we encrypt the username and password using PHP?
The functions in this section perform encryption and decryption, and compression and uncompression:
encryption decryption




ENCRYPT() Not available

MD5() Not available

OLD_PASSWORD() Not available

PASSWORD() Not available

SHA() or SHA1() Not available


oDesk Certified Software Testing Engineer


vaasu said...

nice.. good and thanks

Sree said...

Its Really Nice if possible can u add the reaming QAS
Thanku so much

Avi said...

nice post dude.
keep going

dileswar said...

Thank u so much, for posting like good qa.I m looking forward to u r further update.

free tutorials said...

Hey thanks a lot for sharing useful interview questions..... which will be very helpful while attending the interviews.....
glad i found ur site...really a very helpful site.....
by the way check out my collection of php interview questions from here: php interview questions

varun s said...

nice.. good and thanks

mallorca said...


Tks very much for post:

I like it and hope that you continue posting.

Let me show other source that may be good for community.

Source: Sample interview questions

Best rgs

ranji said...

good information about php

Anonymous said...


Anonymous said...

Thanks ...

car hire chennai said...

good information thanks for sharing it

shivsingh said...

how to show a user is online if it show then i close my browser then i will be online or not without logout?.........

shivsingh said...
This comment has been removed by a blog administrator.
shivsingh said...
This comment has been removed by a blog administrator.
avinash sahu said...

good collection bro.

Kinal Patel said...

Thank you so much i have lot of things from this interview question

Nitin Gautam said...
This comment has been removed by the author.
Nitin Gautam said...

nice post buddy.......but these questions are to be asked on fresher level also.........so could u provide somo more advance questions..........

I would be thankfull to u

Anonymous said...

Nice tutorial.. very thanks for sharing this information

mallesh said...

thq u very much
i am new in php so it more help to me i can understand easily to this Q and A

mallesh said...

plz post more questions on advanced topic of php also it wil helpful to biginers and exp

muthu juna said...

thank u sir

Best PHP Training in Chennai

Android Training in Chennai said...

Thanks for sharing such useful information on the blog and refer the link Android Training in Chennai

Android Training in Chennai said...

Thanks for sharing such useful information on the blog and refer the link Android Training in Chennai

Dot Net Training in Chennai said...

Thanks for sharing such useful information on the blog and refer the link Dot Net Training in Chennai

Dot Net Training in Chennai said...

Awesome Blogs share more information and refer the link Dot Net Training in Chennai

christina jeni said...

It was really a wonderful article and I was really impressed by reading this blog. We are giving all software Course Online Training. The HTML5 Training in Chennai is one of the reputed Training institute in Chennai.

Roshini Balu said...

The information you have posted here is really useful and interesting too & here, I had a chance to gather some useful tactics in programming, thanks for sharing and I have an expectation about your future blogs keep your updates please
PHP Training Chennai

Martina Christy said...

Your blog is really awesome. Thanks for sharing this blog. If anyone want to get PHP Training in Chennai, please visit Fita academy located at Chennai, Velachery.

Roshini RS said...

It’s too informative blog and I am getting conglomerations of info’s about .Thanks for sharing, I would like to see your updates regularly so keep blogging.
Angular training in Chennai

Roshini RS said...

Thanks for sharing your view to our knowledge’s, its helps me plenty keep sharing…

Angular course in Chennai

Emi Jackson said...

Thanks for your wonderful post.It is really very helpful for us and I have gathered some important information from this blog.If anyone wants to get Dot Net Training in Chennai reach FITA, rated as No.1 Dot Net Training Institute in Chennai.

Andria BZ said...

Good collection of php interview questions...

PHP Training in Chennai

john son said...

Java Training

Hi I am Johnson lives in Chennai. I am a technology freak. Recently I did Java Training in Chennai at a leading Java Training Institutes in Chennai. This is really helpful for me to make a bright career in IT industry.

Best Java Training in Chennai

Java Training Chennai

rebeka christy said...

Android Training in Velachery

Your blog is really useful for me. Thanks for sharing this useful blog..Suppose if anyone interested to learn Android Training in Chennai please visit fita academy which offers best Android Training Chennai at reasonable cost.

Android Training Institutes in Chennai

jack wilson said...

Its really awesome blog..If anyone wants to get Software Testing Course in Chennai visit FITA IT academy located at Chennai. Rated as No.1 and Best Software Testing Training Institute in Chennai


Software Testing Training

jack wilson said...

QTP Training in Chennai

Hi, I wish to be a regular contributor of your blog. I have read your blog. Your information is really useful for beginner. I did Software Testing Course in Chennai at Fita training and placement academy which offer best Software Testing Training in Chennai with years of experienced professionals. This is really useful for me to make a bright career.


Software Testing Training Institutes in Chennai

varshini devi said...

Thanks for sharing this valuable post to my knowledge great pleasure to be here SAS has great scope in IT industry. It’s an application suite that can change, manage & retrieve data from the variety of origin & perform statistical analytic on it, if anyone looking for best sas training in Chennaiget into FITA…

Emi Jackson said...

Unix Course Chennai

Thanks for sharing this informative blog. Suppose if anyone interested to learn Unix Training Chennai, Please visit Fita Academy located at Chennai, Velachery. Rated as No.1 Unix Training Centers in Chennai


Best Unix Training in Chennai

Victoria John said...

Best HTML5 Training in Chennai

Your blog is really awesome. Thank you for your sharing this informative blog. Recently I did PHP course at a leading academy. If you are looking for best PHP Training Institute in Chennai visit FITA IT training academy which offer real time PHP Training in Chennai.

PHP Course in Chennai

dhanamlakshmi palu said...

Thanks for sharining the important information about PHP,Mysql. Thanks a lot.
PHP Training in chennai | PHP Training chennai | PHP course in chennai | PHP course chennai

Suranka VMware said...

Nice article i was really impressed by seeing this article, it was very interesting and it is very useful for Learners..
Mysql Training in chennai | Mysql Training chennai | Mysql course in chennai | Mysql course chennai

dhanalakshmi palu said...

Your posts is really helpful for me.Thanks for your wonderful post. I am very happy to read your post.
HTML5 Training in chennai | HTML5 Training chennai | HTML5 Course in chennai | HTML5 course chennai

karunakar2093 said...

thanks for sharing this articles codeigniter interview questions

Gurleen Singh said...

This article is very interesting to learn. All the features are very helpful. Thanks for sharing with us.

Php Training Ludhiana

Best Regards,
Gurleen Singh

Melisa said...

Thanks for sharing this niche useful informative post to our knowledge, Actually PHP is an open source software that can be used in many companies for their day to day business activities it has great scope in future
PHP Institutes in Chennai|Best PHP Training in Chennai|PHP Training

Amirtha rao said...

I ever had seen this information over the blog sites; actually I am looking forward for this information. Here I had an opportunity to read, it was crystal clear keep sharing because I have an expectation about your upcoming post.
Web design training Chennai|Web design training institute in Chennai|Web design courses in Chennai

asitbangalorereviews said...

Thank u.. Good collection
Mysql Interview Questions and Answers

Manjot kaur said...

Great information provided. I appreciate your work. I like the way you write. Awesome, keep it up.

6 Month php Industrial Training in Chandigarh
6 weeks php industrial training in chandigarh