YouTube Icon

Interview Questions.

Top 29 Lamp Interview Questions - Jul 26, 2022

fluid

Top 29 Lamp Interview Questions

Q1. What Is Htmlentities And What Is Their Functionality ?

Htmlentities() just converts the characters into HTML entities.

Q2. What Is A Trigger And Does Mysql Support Triggers ?

A trigger is a database object this is related to a particular table in a database. It gets activated robotically and plays whilst both INSERT, UPDATE, DELETE movement takes place on the desk.

MySQL supports triggers from MySQL five.Zero.2 version.

Q3. Please State How To Submit A Form Without Using A Submit Button ?

We can put up a shape without using a post button by having a JavaScript code linked to any occasion trigger of a shape field. And just add the code record.Shape.Publish() characteristic to put up the form while the event is precipitated.

Q4. What Is Urlencode() And Urldecode() ?

Urlencode() converts special characters into characters which are safe for use in URL’s. Mostly they're transformed into % symptoms at the side of 2 hex digits.

For ex: urlencode(“20:00%) is converted into “25p.C2E00%25?”

urldecode() does the alternative and returns the decoded string..

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

The Unlink() function deletes the file while Unset() makes a fixed variable as undefined.

Q6. How You Will Define A Session ?

A Session is a technique to store some data for use throughout multiple pages. In technical terms it's far a logical item this is saved in the server to help you shop facts and may be accessed across multiple HTTP requests. Session is always temporary primarily based on the consultation timeout set for your Apache Server.

Q7. Can You Encrypt Your Password In Php And How To Do It ?

Yes, you can encrypt passwords and all styles of facts in PHP the usage of md5() or sha() functions.

Q8. How Can We Unset The Variable Of A Session ?

With the session_unset($variable_name) function, you possibly can clear the consultation variable.

Q9. Please State How Can You Take A Backup Of The Whole Database In Mysql ?

You can use the command line utility to take a backup of all the mysql table or a specific mysql table without difficulty with the following:

mysqldump –-consumer [user_name] –-password=[password] [database_name] > [dump_file_name]

Q10. How You Will Find The Number Of Elements Present In An Array ?

To discover the no. Of factors in an array, you may both use rely() or sizeof() function

Ex:  be counted($array) or sizeof($array).

Q11. Can You Execute A Php Script In Command Line ?

Yes, we can execute a PHP script in command line with the following command line argument

# personal home page yourscript.Hypertext Preprocessor

Where personal home page is the command to execute the php script in a Command Line Interface (CLI)

Q12. State The Main Difference Between Mysql_fetch_array And Mysql_fetch_object ?

Mysql_fetch_array will fetch all the matching information, while mysql_fetch_object will only fetch the primary document that suits the question.

Q13. Can You Increase The Execution Time Of A Php Script ?

Yes, we will use the max_execution_time variable to set the preferred time you wished for executing a php script.

Q14. How Can We Encrypt And Decrypt A Data Present In A Mysql Table Using Mysql ?

To encrypt facts in a mysql desk, you can use the following: AES_ENCRYPT () and AES_DECRYPT ()

Q15. State The Main Difference Between Mysql_connect And Mysql_pconnect ?

With mysql_connect, you open a database connection each time whilst the page masses, while with mysql_pconnect, connection receives installed best as soon as and presents get right of entry to to the database throughout a couple of requests.

Q16. What Are The Types Of Errors In Php And Explain Each One Of Them ?

The sorts of mistakes in PHP are Notices, Warnings & Fatal Errors.

Notices are less vital mistakes which you don’t want to offer an awful lot significance to it. Like mistakes that arise, when you try to access a variable that isn't always described. If you change the attention errors to be no longer displayed, you won’t see those kinds of errors at all.

Warnings are mistakes of some extreme nature that call for your attention. Even although those errors are displayed to the consumer, the script will not terminated. Example of this error consists of accessing a document that doesn’t exist.

Fatal Errors are project crucial mistakes that bring about on the spot termination of your script. Examples of those errors include, calling an item of a non-existent class and so forth.

Q17. What Is Sql Injection And How Do You Deal With That ?

SQL injection is a way utilized by hackers to get get right of entry to into your database via the use of malicious SQL statements. Using this, everybody can gain complete get admission to to your database without any authorization or permission.

To start with one want to use mysql_real_escape_string() to filter the user input statistics, earlier than passing onto the sq. Declaration.

Q18. State The Main Difference Between $message And $$message ?

$message is a name of a variable, while $$message is a variable with its call saved interior $message.

For instance if $message=”var”, then $$message is similar to $var

Q19. Is Php A Case Sensitive Programming Language ?

It is partially case sensitive, where we will use function and class names in case touchy manner however variables need to be used in a case sensitive way.

Q20. Can You Increase The Maximum Upload Size In Php ?

Yes, we will use the upload_max_filesize variable to change the most length of a report you may upload.

Q21. Please Explain The Output Of The Code Provided Below And Explain The Reasoning ?

$a = 012; Echo $a / four;

The wer is 2.5.

In PHP, on every occasion quite a number is prefixed with zero, it'll be considered as an octal range, and as a result the 012 octal wide variety is equivalent to the decimal quantity 10, and so 10/4 is 2.Five

Q22. What Php Image Functions Do You Use To Get The Properties Of An Image ?

There are numerous php photos functions that offers with images and you can use:

exif_imagetype() – To get the form of the picture

getimagesize() – To get the size of the image

imagesx() – To get the width of the image

imagesy() – To get the peak of the picture

Q23. How Do You Register The Variables Into A Session ?

To check in variables in a consultation, you want to apply the session_register() function

Ex: session_register($login_id)

Q24. How To Destroy A Session Variable ?

Session_unregister() Unregister a international variable from the present day consultation

Q25. State The Main Difference Between Require And Include, Include_once ?

The essential difference is that after the use of require, it's going to throw a fatal error when a document isn't always determined, whereas include and include_once will show a warning and continue to load the web page.

Q26. How To Repair A Table In Mysql ?

To restore a desk in MySQL you want to use the following question: 

REPAIR TABLE desk name

REPAIR TABLE table name  QUICK / EXTENDED

MySQL will do a restore of most effective the index tree, If QUICK is given

MySQL will create index row by using row, If EXTENDED is given.

Q27. What Is Nl2br() ?

Nl2br() feature inserts HTML line breaks earlier than every newline in a string.

For example nl2br(“How are you”) will go back strings delivered with HTML line breaks before all new strains in a string, and the output could be like:

How

are

you

Q28. How To Destroy A Cookie ?

You just want to set the cookie to a preceding date or time.

Q29. How Can One Handle Loops In Php ?

In PHP, you the looping statements like whilst, do while, for and for each.




CFG