YouTube Icon

Interview Questions.

Top 50 Php+mysql Interview Questions - Jul 27, 2022

fluid

Top 50 Php+mysql Interview Questions

Q1. How Can We Get The Properties (size, Type, Width, Height) Of An Image Using Php Image Functions?

To know the Image type use exif_imagetype ()

function To recognize the Image length use getimagesize ()

feature To recognize the photograph width use imagesx ()

feature To know the image top use imagesy() function t

Q2. How Many Ways We Can Give The Output To A Browser?

HTML output

PHP, ASP, JSP, Servlet Function

Script Language output Function

Different Type of embedded Package to output to a browser

Q3. How Can We Get The Browser Properties Using Php?

By using $_SERVER['HTTP_USER_AGENT'] variable.

Q4. How To Get The Http Request In Php?

When PHP is used on a Web server to deal with a HTTP request, it converts records submitted within the HTTP request as predefined variables:

$_GET - Associate array of variables submitted with GET approach.

$_POST - Associate array of variables submitted with POST method.

$_COOKIE - Associate array of variables submitted as cookies.

$_REQUEST - Associate array of variables from $_GET, $_POST, and $_COOKIE.

$_SERVER - Associate array of all statistics from the server and the HTTP request.

Q5. How Can We Know The Number Of Days Between Two Given Dates Using Mysql?

  SELECT DATEDIFF(’2007-03-07′,’2005-01-01′);

Q6. How Can We Destroy The Session, How Can We Unset The Variable Of A Session?

Session_unregister — Unregister a worldwide variable from the modern session session_unset — Free all session variables

Q7. How Can We Create A Database Using Php And Mysql?

We can create MySQL database with using mysql_create_db(“Database Name”)

Q8. How Can We Optimize Or Increase The Speed Of A Mysql Select Query?

To begin with in place of using pick out * from table1, use pick column1, column2, column3.. From table1

Look for the opportunity to introduce index within the desk you're querying.

Use restriction key-word if you are looking for any particular wide variety of rows from the result set.

Q9. What Are The Other Commands To Know The Structure Of A Table Using Mysql Commands Except Explain Command?

DESCRIBE table_name;

Q10. What Are The Current Versions Of Apache, Php, And Mysql?

PHP: PHP 5.1.2

MySQL: MySQL five.1

Apache: Apache 2.1

Q11. What Is Meant By Urlencode And Urldecode?

Urlencode() returns the URL encoded model of the given string. URL coding converts special characters into % signs and symptoms followed with the aid of  hex digits.

For instance: urlencode(”10.00%”) will go back “10percent2E00percent25″. URL encoded strings are safe for use as part of URLs. Urldecode() returns the URL decoded version of the given string.

Q12. Can We Use Include ("abc.Php") Two Times In A Php Page "makeit.Php"?

Yes we can use include() a couple of time in any page although it isn't always a very good practice.

Q13. How Do I Find Out The Number Of Parameters Passed Into Function9?

Func_num_args() characteristic returns the number of parameters handed in.

Q14. What Is The Php Predefined Variable That Tells The What Types Of Images That Php Supports?

Though i'm no longer positive if this is incorrect or not, With the exif extension you are able to work with photo meta information.

Q15. Will Comparison Of String "10" And Integer 11 Work In Php?

Yes, internally PHP will solid the whole thing to the integer type, so numbers 10 and 11 will be compared.

Q16. In How Many Ways We Can Retrieve Data In The Result Set Of Mysql Using Php?

Mysql_fetch_array – Fetch a result row as an associative array, a numeric array, or both

mysql_fetch_assoc – Fetch a result row as an associative array

mysql_fetch_object – Fetch a result row as an item

mysql_fetch_row —- Get a end result row as an enumerated array

Q17. Tools Used For Drawing Er Diagrams.

Case Studio

Smart Draw

Q18. List Out Some Tools Through Which We Can Draw E-r Diagrams For Mysql.

Case Studio

Smart Draw

Q19. Can We Use Include(abc.Personal home page) Two Times In A Php Page Makeit.Personal home page?

Yes we are able to include that typically we want, but right here are some things to make sure of:

(together with abc.PHP, the file names are case-sensitive) there shouldn’t be any reproduction feature names, me there need to no longer be functions or training or variables with the same name in abc.PHP and makeit.Php.

Q20. What's The Difference Between Accessing A Class Method Via -> And Via ::?

:: is allowed to get admission to methods that can perform static operations, i.E. Those, which do not require item initialization.

Q21. What Is A Persistent Cookie?

A continual cookie is a cookie that is saved in a cookie record permanently on the browser’s laptop. By default, cookies are created as transient cookies which saved simplest within the browser’s reminiscence. When the browser is closed, temporary cookies will be erased. You ought to determine while to apply temporary cookies and whilst to use chronic cookies based on their differences:

Temporary cookies cannot be used for tracking long-term statistics.

Persistent cookies can be used for tracking lengthy-term facts.

Temporary cookies are safer because no applications other than the browser can access them.

Persistent cookies are less secure because users can open cookie files see the cookie values.
 

Q22. What Is The Difference Between Reply-to And Return-direction In The Headers Of A Mail Function?

Reply-to: Reply-to is where to transport the reply of the mail.

Return-route: Return route is whilst there is a mail shipping failure takes place then where to shipping the failure notification.

Q23. What's The Output Of The Ucwords Function In This Example?

$formatted = ucwords(”FYICENTER IS COLLECTION OF INTERVIEW QUESTIONS”);

print $formatted;

What could be printed is FYICENTER IS COLLECTION OF INTERVIEW QUESTIONS.

Ucwords() makes each first letter of every phrase capital, however it does now not decrease-case something else. To avoid this, and get a nicely formatted string, it’s well worth using strtolower() first.

Q24. So If Md5() Generates The Most Secure Hash, Why Would You Ever Use The Less Secure Crc32() And Sha1()?

Crypto usage in PHP is easy, however that doesn’t suggest it’s loose. First off, depending at the statistics which you’re encrypting, you would possibly have motives to save a 32-bit value in the database instead of the a hundred and sixty-bit value to save on area. Second, the extra secure the crypto is, the longer is the computation time to supply the hash cost. A high quantity site might be extensively slowed down, if frequent md5() generation is needed.

Q25. What Are The Different Types Of Errors In Php?

Here are 3 primary types of runtime errors in PHP:

Notices: These are trivial, non-essential mistakes that PHP encounters while executing a script – as an instance, accessing a variable that has not yet been described. By default, such mistakes are not displayed to the person at all – despite the fact that you can alternate this default behavior.

Warnings: These are extra critical errors – for instance, trying to encompass() a report which does now not exist. By default, these errors are exhibited to the person, however they do not bring about script termination.

Fatal errors: These are vital mistakes – as an example, instantiating an object of a non-existent magnificence, or calling a non-existent feature. These errors reason the immediate termination of the script, and PHP’s default behavior is to show them to the consumer after they take place.

Internally, those versions are represented via twelve different blunders types

Q26. What Is 'drift' Property In Css?

The flow property sets in which an image or a text will appear in every other detail.

Q27. How Can We Repair A Mysql Table?

The syntex for repairing a MySQL desk is REPAIR TABLENAME, [TABLENAME, ], [Quick],[Extended] This command will repair the desk specific if the fast is given the MySQL will do a restore of handiest the index tree if the prolonged is given it's going to create index row through row

Q28. List Out The Predefined Classes In Php?

You can preserve  separate language record for every of the language. All the labels are installed each language files as variables and assign the ones variables within the PHP source. On runtime pick the required language alternative.

Q29. If The Variable $a Is Equal To five And Variable $b Is Equal To Character A, What's The Value Of $$b?

5, it’s a connection with present variable.

Q30. What's The Difference Between Include And Require?

It’s how they handle screw ups. If the document isn't always found by require(), it'll motive a fatal mistakes and halt the execution of the script. If the record isn't discovered by means of encompass(), a caution could be issued, but execution will continue.

Q31. What Are The Differences Between Require And Include, Include_once?

Require_once() and include_once() are each the features to encompass and evaluate the required record best as soon as. If the specified report is included previous to the present name incidence, it's going to not be carried out once more.

But require() and consist of() will do it as in many instances they are asked to do.

Q32. How Many Ways We Can We Find The Current Date Using Mysql?

  SELECT CURDATE();  CURRENT_DATE() = CURDATE()  for time use  SELECT CURTIME();  CURRENT_TIME() = CURTIME()

Q33. 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 /risks Of These Methods?

There are 2 methods to reveal some part of a textual content in red:

Using HTML tag <font color=”red”>

Using HTML tag <span style=”color: red”>

Q34. Suppose Your Zend Engine Supports The Mode <? ?> Then How Can U Configure Your Php Zend Engine To Support <?Php ?> Mode ?

In Hypertext Preprocessor.Ini file: set short_open_tag=on to make PHP guide

Q35. How Can We Encrypt And Decrypt A Data Presented In A Table Using Mysql?

You can use features: AES_ENCRYPT() and AES_DECRYPT() like:

AES_ENCRYPT(str, key_str)

AES_DECRYPT(crypt_str, key_str)

Q36. When Are You Supposed To Use Endif To End The Conditional Statement?

When the unique if become followed by : and then the code block with out braces.

Q37. How Can I Retrieve Values From One Database Server And Store Them In Other Database Server Using Php?

For this cause, you can first study the statistics from one server into session variables. Then connect to different server and virtually insert the information into the database.

Q38. What Is The Difference Between Group By And Order By In Sql?

ORDER BY [col1],[col2],…,[coln]; Tels DBMS in step with what columns it should sort the result. If two rows will hawe the identical cost in col1 it'll try and kind them in step with col2 and so forth.GROUP BY [col1],[col2],…,[coln]; Tels DBMS to organization outcomes with identical price of column col@You can use COUNT(col1), SUM(col1), AVG(col1) with it, if you want to count all objects in institution, sum all values or view common.

Q39. Steps For The Payment Gateway Processing?

An on line payment gateway is the interface between your merchant account and your Web web site. The on line fee gateway permits you to at once verify credit card tractions and authorize finances on a client’s credit score card immediately out of your Web website online. It then passes the traction off to your merchant financial institution for processing, usually referred to as traction batching

Q40. How To Turn On The Session Support?

The session help can be became on routinely at the website online level, or manually in each PHP page script:

Turning on session help routinely at the web site degree: Set consultation.Auto_start = 1 in Hypertext Preprocessor.Ini.

Turning on consultation aid manually in each web page script: Call session_start() characteristic.

Q41. Would You Initialize Your Strings With Single Quotes Or Double Quotes?

Since the information inside the single-quoted string isn't always parsed for variable substitution, it’s continually a better idea pace-smart to initialize a string with unmarried rates, except you in particular need variable substitution.

Q42. What Is The Difference Between The Functions Unlink And Unset?

Unlink() deletes the given document from the record device.

Unset() makes a variable undefined.

Q43. What Is Meant By Pear In Php?

PEAR is the subsequent revolution in PHP. This repository is bringing higher degree programming to PHP. PEAR is a framework and distribution system for reusable PHP components. It eases set up by using bringing an automated wizard, and packing the electricity and revel in of PHP customers right into a well organised OOP library. PEAR also offers a command-line interface that can be used to routinely installation “applications”

Q44. 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 five styles of tables we can create

MyISAM

Heap

Merge

INNO DB

ISAM

MyISAM is the default storage engine as of MySQL 3.23 and as a end result if we do not specify the desk call explicitly it will be assigned to the default engine.

Q45. How Many Tables Will Create When We Create Table, What Are They?

The ‘.Frm’ record shops the table definition.

The statistics record has a ‘.MYD’ (MYData) extension.

The index document has a ‘.MYI’ (MYIndex) extension.

Q46. What Are The Different Ways To Login To A Remote Server? Explain The Me, Advantages And Disadvantages?

There is as a minimum three approaches to logon to a remote server:

Use ssh or telnet if you difficulty with protection

You can also use rlogin to logon to a far off server.

Q47. Functions In Imap, Pop3 And Ldap?

You can locate these precise data in PHP Manual.

Q48. How Can We Submit A Form Without A Submit Button?

The major idea at the back of that is to apply Java script submit() feature so one can put up the shape with out explicitly clicking any publish button. You can connect the record.Formname.Submit() approach to onclick, onchange events of different inputs and carry out the shape submission. You may even built a timer characteristic in which you may mechanically submit the form after xx seconds once the loading is performed (may be visible in on line test web sites).

Q49. What Are The Mysql Database Files Stored In System ?

Data is stored in call.Myd

Table structure is saved in name.Frm

Index is stored in name.Myi

Q50. How Can We Know The Number Of Days Between Two Given Dates Using Php?

  $date1 = date(‘Y-m-d’);  $date2 = ’2006-08-15′;  $days = (strtotime($date1) – strtotime($date2)) / (60 * 60 * 24);




CFG