(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: set_password_form.ml,v 1.2 2006/03/27 18:09:46 rich Exp $
+ * $Id: set_password_form.ml,v 1.3 2006/03/28 16:24:08 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 userid = Int32.of_string (q#param "userid") in
- let sth = dbh#prepare_cached "select name from users
- where id = ? and hostid = ?" in
- sth#execute [Some userid; Some hostid];
-
- let username = sth#fetch1string () in
+ let username = List.hd (
+ PGSQL(dbh)
+ "select name from users
+ where id = $userid and hostid = $hostid"
+ ) in
template#set "userid" (Int32.to_string userid);
template#set "username" username;