(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: contacts.ml,v 1.1 2004/09/17 16:03:34 rich Exp $
+ * $Id: contacts.ml,v 1.2 2005/11/23 11:32:12 rich Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
(* Pull out all the contacts from the database. *)
let sth = dbh#prepare_cached
"select c.id, c.name, c.subject,
- (select count(*) from contact_emails
+ (select count(*)::int4 from contact_emails
where contactid = c.id)
from contacts c
where c.hostid = ?
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: delete_contact.ml,v 1.2 2004/09/23 11:56:47 rich Exp $
+ * $Id: delete_contact.ml,v 1.3 2005/11/23 11:32:13 rich Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
(* Need to check the contact emails all belong to this host. *)
let qs = Dbi.placeholders (List.length ids) in
- let sth = dbh#prepare_cached ("select count(*) from contacts
+ let sth = dbh#prepare_cached ("select count(*)::int4 from contacts
where hostid = ? and id in " ^ qs) in
sth#execute (`Int hostid :: (List.map (fun id -> `Int id) ids));
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_user_form.ml,v 1.7 2004/10/11 14:13:04 rich Exp $
+ * $Id: edit_user_form.ml,v 1.8 2005/11/23 11:32:13 rich Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
"select u.name, u.email, u.registration_date,
u.can_edit, u.can_manage_users, u.can_manage_contacts,
u.can_manage_site, u.can_edit_global_css, u.can_import_mail,
- (select count(*) from pages where logged_user = u.id),
+ (select count(*) from pages where logged_user = u.id)::int4,
(select count(*) from pages
- where logged_user = u.id and url_deleted is null)
+ where logged_user = u.id and url_deleted is null)::int4
from users u where u.hostid = ? and u.id = ?" in
sth#execute [`Int hostid; `Int userid];
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: rebuild_links.ml,v 1.3 2004/10/23 12:00:24 rich Exp $
+ * $Id: rebuild_links.ml,v 1.4 2005/11/23 11:32:13 rich Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
(* Estimate how many sections we will have to process. *)
let sth =
dbh#prepare_cached
- "select count(c.id) from contents c, pages p
+ "select count(c.id)::int4 from contents c, pages p
where c.pageid = p.id
and p.hostid = ?
and p.url is not null
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: recent.ml,v 1.9 2004/10/21 18:35:01 rich Exp $
+ * $Id: recent.ml,v 1.10 2005/11/23 11:32:13 rich Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
let template = get_template dbh hostid "recent.html" in
(* Count the number of changes. *)
- let sth = dbh#prepare_cached "select count(*) from pages where hostid = ?" in
+ let sth = dbh#prepare_cached
+ "select count(*)::int4 from pages where hostid = ?" in
sth#execute [`Int hostid];
let count = sth#fetch1int () in