phprockers-logo

Explain about the $_GET variable of PHP?

0 comments
This GET variable is executed when a request is sent from the user for information. This GET gets executed on the server and then information is sent back to the user. The information transmitted through this GET variable is viewable by everyone and is displayed in the address bar of the browser. A maximum of 100 characters is sent by the GET variable.

Difference between mysql_connect and mysql_pconnect?

0 comments
1. mysql_connection must be closed, we can't use this to connect another database means it is suitable for only one database accessing......

2.mysql_pconnect means opens a persistent connection, with this we use same host name, username, and password. we can access different databases at a time in the same program. we can't close the connection.

PHP interview Questions and Answers

0 comments
1. What is CAPTCHA?

CAPTCHA stands for Completely Automated Public Turing Test to tell Computers and Humans Apart. To prevent the users from using bots to automatically fill out forms. CAPTCHA programmers will generate an image containing distorted images of a string of numbers and letters. Computers cannot determine what the numbers and letters are from the image but humans have great pattern recognition abilities and will be able to fairly accurately determine the string of numbers and letters. By entering the numbers and letters from the image in the validation field, the application can be fairly assured that there is a human client using it. To read more look here:
http://en.wikipedia.org/wiki/Captcha

what is the difference between print and echo in php

0 comments
1. echo is faster than print.
2. print returns a int value and echo returns no value / a void value. 
3. print cannot take multiple expressions

Whats are the differences between Get and post methods in php?

0 comments
GET method have not security because of data view in addressbar.
POST method have security of data.

With GET we can send only 4 kb data but with POST there is no limit and also it is secure than GET.

What is the difference between mysql_fetch_object and mysql_fetch_array?

0 comments
Mysql_fetch_object returns the result from the database as objects while mysql_fetch_array returns result as an array. This will allow access to the data by the field names.

E.g. 
using mysql_fetch_object field can be accessed as $result->name &
using mysql_fetch_array field can be accessed as $result[name]

Explain the ternary conditional operator in PHP?

0 comments
Expression preceding the ? is evaluated, if it’s true, then the expression preceding the : is executed, otherwise, the expression following : is executed. 

if(exp1?exp2:exp3 )

If exp1 condition is true, exp2 will be print. If exp1 is false, exp3 will be print.