Tutorial by Topics: prepare

PREPARE stmt_name FROM preparable_stmt EXECUTE stmt_name [USING @var_name [, @var_name] ...] {DEALLOCATE | DROP} PREPARE stmt_name
A PreparedStatement declares the statement before it is executed, and allows for placeholders for parameters. This allows the statement to be prepared (and optimized) once on the server, and then reused with different sets of parameters. The added benefit of the parameter placeholders, is that it...
official documentation: Prepared Statement Object
Warning Prepared statement cannot care a wild parameter for the table names. For exemple this following statement is not correct : $query = "SELECT name, city FROM ? WHERE id = ? AND country = ?"; The correct prepared query would be : $query = "SELECT name, city FROM users WHE...

Page 1 of 1