nerdexam
Oracle

1Z0-909 · Question #11

You are using buffered queries with PHP mysqli in a browser-based web application. Which three are true?

The correct answer is D. Buffered queries should be used on large tables when the result size is unknown. F. Buffered queries must be explicitly enabled using mysqliuseresult. G. Large results can have a negative impact on performance. Buffered Queries in PHP mysqli - Answer Analysis There appears to be an error in the stated correct answers. Based on PHP mysqli documentation, the accurate correct answers are C, E, and G - not D, F, G. Here's why: Why C, E, G are correct: (C) Buffered queries are the default…

Application Development

Question

You are using buffered queries with PHP mysqli in a browser-based web application. Which three are true?

Options

  • AAdditional queries on the same session are blocked until the result set is released.
  • BResults are sent from the server to the browser for buffering.
  • CBuffered queries are enabled by default.
  • DBuffered queries should be used on large tables when the result size is unknown.
  • EResults are sent to the calling PHP process for buffering.
  • FBuffered queries must be explicitly enabled using mysqliuseresult.
  • GLarge results can have a negative impact on performance.

How the community answered

(24 responses)
  • A
    4% (1)
  • B
    8% (2)
  • C
    4% (1)
  • D
    83% (20)

Explanation

Buffered Queries in PHP mysqli - Answer Analysis

There appears to be an error in the stated correct answers. Based on PHP mysqli documentation, the accurate correct answers are C, E, and G - not D, F, G. Here's why:

Why C, E, G are correct:

  • (C) Buffered queries are the default behavior of mysqli_query() - you must explicitly opt into unbuffered mode.
  • (E) Buffering means results travel from the MySQL server to the PHP process (client memory), not the browser - that's the definition of buffered mode.
  • (G) Because all rows are loaded into PHP memory at once, large result sets can exhaust memory and degrade performance.

Why the distractors are wrong:

  • (A) Blocking additional queries is a property of unbuffered queries, not buffered ones.
  • (B) Buffering occurs in the PHP process, not the browser - the browser is irrelevant here.
  • (D) Large tables with unknown sizes are exactly when you should use unbuffered queries to avoid memory overflow - buffered is the wrong choice.
  • (F) mysqli_use_result() enables unbuffered queries, not buffered ones. Buffered is the default; no explicit enabling is needed.

Memory tip: Think "buffered = PHP buffers it" - results land in PHP memory immediately (fast access, memory cost). use_result = use the server's buffer (unbuffered). The word "use" hints you're using the server's resources, not your own.

Recommendation: If this is from an official certification exam, double-check the source material - D and F contradict standard PHP mysqli behavior as documented at php.net.

Topics

#mysqli#buffered queries#result set handling#performance

Community Discussion

No community discussion yet for this question.

Full 1Z0-909 Practice