What is magic methods in php?

The function names __construct, __destruct, __call, __callStatic, __get, __set, __isset, __unset, __sleep, __wakeup, __toString, __invoke, __set_state and __clone are magical in PHP classes. You cannot have functions with these names in any of your classes unless you want the magic functionality associated with them.

What is stored procedure?

A stored procedure is a set of SQL commands that has been compiled and stored on the database server.

Once the stored procedure has been “stored”, client applications can execute the stored procedure over and over again without sending it to the database server again and without compiling it again.

Stored procedures improve performance by reducing network traffic and CPU load.

Stored procedures are essentially functions that you can create in the database and reuse. What’s neat about them from a usability standpoint is that they can take input parameters and then return a result.

What is the difference between Drop,Delete and Truncate?

The DELETE command is used to remove rows from a table. A WHERE clause can be used to only remove some rows. If no WHERE condition is specified, all rows will be removed. After performing a DELETE operation you need to
COMMIT or ROLLBACK the transaction to make the change permanent or to undo it.
TRUNCATE removes all rows from a table. The operation cannot be rolled back. As such, TRUCATE is faster and doesn’t use as much undo space as a DELETE.
The DROP command removes a table from the database. All the tables’ rows, indexes and privileges will also be removed. The operation cannot be rolled back.

What is PHP ini_set() ?

Sets the value of the given configuration option. The configuration option will keep this new value during the script’s execution, and will be restored at the script’s ending.

<?php
echo ini_get(‘display_errors’);
if (!ini_get(‘display_errors’)) {
ini_set(‘display_errors’, 1);
}
echo ini_get(‘display_errors’);
?>

What is the difference between primary and unique key?

Primary Key: A column in a table whose values uniquely identify the rows in the table. A primary key value cannot be NULL.

Unique Key: Unique Keys are used to uniquely identify each row in an Oracle table. There can be one and only one row for each unique key value.

Surrogate Key: A system generated key with no business value. Usually implemented with database generated sequences.