GRM - 7B - Php&mysql - Viva (Q&A)
GRM - 7B - Php&mysql - Viva (Q&A)
1) What is PHP?
PHP stands for Hypertext Preprocessor. It is an open source server-side scripting
language which is widely used for web development. It supports many databases like
MySQL, Oracle, Sybase, Solid, PostgreSQL, generic ODBC etc.
2) Who is known as the father of PHP?
Rasmus Lerdorf
PHP Engine creates a logical object to preserve data across subsequent HTTP requests,
which is known as session.
Sessions generally store temporary data to allow multiple PHP pages to offer a complete
functional transaction for the same user.
21) What is PHP session_start() and session_destroy() function?
PHP session_start() function is used to start the session. It starts new or resumes the
current session. It returns the current session if the session is created already. If the session
is not available, it creates and returns new sessions.
More details...
NULL is a special data type which can have only one value. A variable of data type
NULL is a variable that has no value assigned to it. It can be assigned as follows:
$var
1 = NULL;
41) What is MySQL?
Answer: MySQL is an open-source DBMS which is developed and distributed by Oracle
Corporation.
It is supported by most of the popular operating systems, such as Windows, Linux, etc. It
can be used to develop different types of applications but it is mainly used for developing
web applications.
44) What are the essential code required for establishing a connection with a MySQL
database using PHP?
The code snippets required for establishing a connection with a MySQL database using
PHP are as follows:
$host = “localhost”;
$username = “root”;
$password = “”;
$database = “test”;
if (!$conn) {
die(“Connection failed: ” . mysqli_connect_error());
}
MySQL is a database that stores and protects numerous sorts of data. A PHP script is
necessary to store and retrieve values from the database.
SQL is used to create database management systems, whereas MySQL allows data
handling, storage, deletion, and modification.