How can I turn off MySQL strict mode? or Solving Incorrect integer value problem with MySQL 5 strict-modeExplain the changing file permission and ownership using PHP's chmod() function.Explain the difference between ereg_replace() and eregi_replace().How many ways I can register the variables into session?How do you define a constant?What is the difference between AIM and SIM in Authorize.Net?If we login more than one browser windows at the same time with same user and after that we close one window, then is the session is exist to other windows or not? And if yes then why? If no then why? ~ Interview Questions & Answers

Wednesday, February 10, 2010

How can I turn off MySQL strict mode? or Solving Incorrect integer value problem with MySQL 5 strict-mode


This can be done in two ways...
Open your "my.ini" (my.cnf in linux) file within the MySQL installation directory, and look for the text "sql-mode".
Find:
# Set the SQL mode to strict
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
Replace with:
# Set the SQL mode to strict
sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
Or, you can run an SQL query within your database management tool, such as phpMyAdmin:
SET @global.sql_mode= '';

Friday, February 5, 2010

Explain the changing file permission and ownership using PHP's chmod() function.

Chmod() is used for changing permissions on a file.
Syntax:
Chmod(file, mode)
Mode here specifies the permissions as follows:
* The first number is always zero
* The second number specifies permissions for the owner
* The third number specifies permissions for the owner's user group
* The fourth number specifies permissions for everybody else
Possible values (to set multiple permissions, add up the following numbers)
* 1 = execute permissions
* 2 = write permissions
* 4 = read permissions
Example:
// everything for owner, read for owner's group
chmod("test.txt",0740);

Sunday, January 3, 2010

Explain the difference between ereg_replace() and eregi_replace().

ereg_replace() is used for matching patters to the input string. It then replaces the matched string.

SYNTAX
string ereg_replace ( string $pattern , string $replacement , string $string )
eregi_replace() is used for matching patters to the input string. It then replaces the matched string. The difference is that this function is case sensitive.

Tuesday, December 15, 2009

How many ways I can register the variables into session?

Global variables in PHP can be registered using the session_register() function. It accepts different number of arguments, any of which can be either a string holding the name of a variable or an array consisting of variable names or other arrays
Example:
Session_register(“simple”);
$_session can also be used for registering variables.
Example:
$_SESSION['count'] = 0;

Wednesday, August 5, 2009

How do you define a constant?

Via define() directive, like define ("MYCONSTANT", 100);

Tuesday, August 4, 2009

What is the difference between AIM and SIM in Authorize.Net?

In SIM (Simple integration Method) customer credit card details are taken on the authorize.net site - no SSL required
AIM (Advanced integration Method) Credit card details are taken over your site SSL require.

please check setup instructions for more details http://www.ecommercetemplates.com/phphelp/ecommplus/authorizenet.asp

Thursday, July 23, 2009

If we login more than one browser windows at the same time with same user and after that we close one window, then is the session is exist to other windows or not? And if yes then why? If no then why?

Session depends on browser. If browser is closed then session is lost. The session data will be deleted after session time out. If connection is lost and you recreate connection, then session will continue in the browser.