What is MYSQL storage engines ?

A storage engine is a software module that a database management system uses to create ,read and update the data from a database.
MySQL supports several storage engines that act as handlers for different table types. MySQL storage engines include both those that handle transaction-safe tables and those that handle nontransaction-safe tables:

MySQL supports following storage engines,

  » MyISAM
  » InnoDB
  » MERGE
  » MEMORY (HEAP)
  » BDB (BerkeleyDB)
  » EXAMPLE
  » FEDERATED
  » ARCHIVE
  » CSV
  » BLACKHOLE

What is array_multisort() in PHP ?

array_multisort() is using to sort several arrays at once or sort multidimensional array, by one or more dimensions.
In this the associative (string) keys will be maintained but numeric keys will be reindexed.

$array1 = array(23,60,50,70);
$array2 = array(2,3,6,5);
array_multisort($array1 , $array2);

OUTPUT:
var_dump($array1);
array(4)
{
[0] => int(23)
[1] => int(50)
[2] => int(60)
[3] => int(70)
}
var_dump(array2);
array(4)
{
[0] => int(2)
[1] => int(6)
[2] => int(3)
[3] => int(5)
}

Why we use strpos() in PHP ?

strpos() using to find the first occurrence of a string in another string. It return the position of the sub-string in a string.If the searched string will not exists in the searching string it return false.

$mystring = “PHP Developer”;
$find = “Developer”;
echo $result = strpos($mystring,$find);

OUTPUT: 4

What is difference between mysql_connect() and mysql_pconnect() ?

mysql_connect() and mysql_pconnect() both are working for database connection but with little difference. In mysql_pconnect(), ‘p’ stands for persistance connection.

When we are using mysql_connect() function, every time it is opening and closing the database connection, depending on the request .

But in case of mysql_pconnect() function,
First, when connecting, the function would try to find a (persistent) connection that’s already open with the same host, username and password. If one is found, an identifier for it will be returned instead of opening a new connection.
Second, the connection to the SQL server will not be closed when the execution of the script ends. Instead, the connection will remain open for future use (mysql_close() will not close connection established by mysql_pconnect()).

mysql_pconncet() is useful when you have a lot of traffice on your site. At that time for every request it will not open a connection but will take it from the pool. This will increase the efficiency of your site. But for general use mysql_connect() is best.

mysql_pconnect() is deprecated as of PHP 5.5.0, and will be removed in the future because it has several disadvantage.