1DB.prepare(3kaya) Kaya module reference DB.prepare(3kaya)
2
3
4
6 DB::prepare - Prepare a database query
7
9 DBStatement<a> prepare( DBHandle<a> con, String query )
10
12 con The database connection
13
14 query The query template. This may contain replacement characters at
15 some places (consult the manual for the specific database to find out
16 what replacement syntax should be used) which will be replaced with
17 variables in the DB.execPrepared (3kaya) function.
18
20 Prepare a database query. Prepared queries can then be executed later,
21 using a parameter-replacement method that generally avoids SQL injec‐
22 tion attacks.
23
24
25 st = prepare(con,"SELECT * FROM Users WHERE username = $1");
26
28 Kaya standard library by Edwin Brady, Chris Morris and others
29 (kaya@kayalang.org). For further information see http://kayalang.org/
30
32 The Kaya standard library is free software; you can redistribute it
33 and/or modify it under the terms of the GNU Lesser General Public
34 License (version 2.1 or any later version) as published by the Free
35 Software Foundation.
36
38 DB.DBStatement (3kaya)
39 DB.execPrepared (3kaya)
40
41
42
43Kaya December 2010 DB.prepare(3kaya)