Vidyalelo
MySQL · Q337

MySQL

Programming · MySQL · question 337

Q337

The variable that is a handle to a database object is . . . . . . . .

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

Answer: Option A

Solution

Answer: Option A
Solution:
This question asks about a special variable that's used to keep track of a database. Think of it like a name tag for your database!

The correct answer is Option A: $dbh. Here's why:

* $dbh is a common convention in PHP code to represent the database handle. It stands for "database handle".

* $sth (Option B) is usually used for a prepared statement handle, which is like a template for sending commands to the database.

* h (Option D) are not commonly used for database handles. They might be used for other purposes, like file handles.

So, when you see $dbh in code, you know it's referring to your database connection!