- let sth =
- dbh#prepare_cached
- "insert into images (hostid, name, image, width, height, alt,
- title, longdesc, class, thumbnail, tn_width,
- tn_height, mime_type, tn_mime_type)
- values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" in
- sth#execute [`Int hostid; `String name; `Binary image; `Int width;
- `Int height; `String alt; title; longdesc; clazz;
- `Binary thumbnail; `Int tn_width; `Int tn_height;
- `String mime_type; `String tn_mime_type];
-
- dbh#commit ();
+ let width = Int32.of_int width in
+ let height = Int32.of_int height in
+ let tn_width = Int32.of_int tn_width in
+ let tn_height = Int32.of_int tn_height in
+ PGSQL(dbh)
+ "insert into images (hostid, name, image, width, height, alt,
+ title, longdesc, class, thumbnail, tn_width,
+ tn_height, mime_type, tn_mime_type)
+ values ($hostid, $name, $image, $width, $height, $alt, $?title,
+ $?longdesc, $?clazz, $thumbnail, $tn_width, $tn_height,
+ $mime_type, $tn_mime_type)";
+
+ PGOCaml.commit dbh;