Module Mysql.Prepared

module Prepared: sig .. end

Prepared statements with parameters. Consult the MySQL manual for detailed description and possible problems.

type stmt 

Prepared statement

type stmt_result 

Prepared query result (rowset)

val create : Mysql.dbd -> string -> stmt

Create prepared statement. Placeholders for parameters are ? and @param. Returned prepared statement is only valid in the context of this connection and can be reused many times during the lifetime of the connection.

val execute : stmt -> string array -> stmt_result

Execute the prepared statement with the specified values for parameters.

val execute_null : stmt -> string option array -> stmt_result

Same as Mysql.Prepared.execute, but with support for NULL values.

val affected : stmt -> int64
val insert_id : stmt -> int64
val real_status : stmt -> int
val fetch : stmt_result -> string option array option
val result_metadata : stmt -> Mysql.result
val close : stmt -> unit

Destroy the prepared statement