79468471

Date: 2025-02-26 03:55:07
Score: 0.5
Natty:
Report link

Your, understanding mostly correct but just clarify:

connection.query(sql,value):

connection.execute(sql,value):

So, B1 function is the most efficient when running the same query multiple times because connection.prepare sends a single query to MySQL to create a prepared statement and also close after execute query.

B2 function is wasteful because it prepares the statement twice.

B3 function is simple but less efficient than B1 for repeated queries.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Utsav Sheta