Vidyalelo
MySQL · Q1049

MySQL

Programming · MySQL · question 1049

Q1049

What is the generic handle whose meaning depends on context?

A.
$dbh
B.
$sth
C.
$fh
D.
$h
Answer

Answer: Option D

Solution

Answer: Option D
Solution:
This question asks about a special symbol used in MySQL that can have different meanings depending on what you're doing.

Think of it like a box that can hold different things. The symbol is like the box, but the specific thing inside the box changes.

The answer is $sth.

$sth is often used to represent a prepared statement, which is a way to write a SQL query once and then use it with different values. This is useful when you have a lot of similar queries.

Let's look at why the other options are incorrect:

* $dbh is usually used to represent a database handle, which connects your program to the MySQL server.
* $fh is often used for file handles, which are used to work with files on your computer.
* $h is not a common symbol in MySQL.

So, $sth is the generic handle that can mean different things depending on the context.