The corresponding MySQLi syntax syntax with the parameter http://php.net/manual/en/mysqli.quickstart.prepared-statements.php :
$stmt = $mysqli->prepare("INSERT INTO test(id) VALUES (?)"); $stmt->bind_param("i", $id);
But never like that:
$stmt = $mysqli->prepare("INSERT INTO test(id) VALUES (:id_value)"); $stmt->bind_param("i", "id_value", $id);
It seems to me that named parameter substitution is a reasonable function, implemented at the API level. I am surprised that MySQLi only implemented unnamed parameters in the library.
Is there a good reason? For me this does not make sense, because all PDO, DQL, ORM still accepted named parameters in their queries.
I hope this was not the case: "We were lazy and do not want" from the MySQLi developers. I believe that there must have been a good reason, and I am looking for this reason or a way to find this reason. The reason that named parameters are not implemented in the MySQLi extension library.
php mysqli named-parameters
Dennis
source share