<HTML><HEAD><TITLE>MSP example: database query called from a
form</TITLE></HEAD> 
<BODY BGCOLOR="#fbf2e7">

<H1>MSP example: database query called from a form</H1>

<?MSP val person = Msp.%%("person", "Peter Sestoft"); ?>

<H2>Messages about <?MSP= person ?></H2>

<?MSP$
let 
    val db = Postgres.openbase
	 { dbhost    = NONE,		(* database server host *)
	   dbname    = SOME "messages",	(* database name        *)
	   dboptions = NONE,		(* options              *)
	   dbport    = NONE,		(* database server port *)
	   dbpwd     = NONE,		(* user passwd          *)
	   dbtty     = NONE,		(* tty for error log    *)
	   dbuser    = SOME "nobody"	(* database user        *)
	 };

    val query = ("SELECT * FROM message WHERE name = '" ^ person ^ "'")
in 
    Postgres.showquery db query
end
?>

<P>This database extract was generated by a mosml server pages script,
invoked from a form generated by another mosml server pages script.  
</BODY> </HTML>
