module Mysql: sig end
val connect : string -> string -> string -> string -> int -> int
Mysql.connect host user password database tcp_port unix_socket
returns an identifier for this connection that should be passed on to all the operations on this connection. Empty values or zeros given to parameters indicate default behaviour.val query : int -> string -> int * int
connection
is used for this query
and the result is a tuple with the number to be used to read the records and the number of affected records by the queryval record : int -> (string * string) list
query-id
inside a set of pairs (fieldname, value), an empty list marks the end of the table or empty resultsval close : int -> unit
connection
val scan : string -> string * string list
query
for expressions between question marks and creates a tuple with the expression to build the query and the list of field names of the resulting records.
To be compatible to the future use of prepared queries (MySQL 4.1 and later) the question mark expressions can only replace normal contants in the query. The prepared statements will be available when MySQL 4.1 becomes the normal stable MySQL soon.
Examples:
insert into table address (name, address, job) value (?name?, ?address?, ?job?)
select 'dear '+name as opening, address where job like ?job_filter?
val finish : unit -> unit
val enum : int -> string -> string -> string
enum connection table field