From: alex <bin...@li...> - 2001-09-25 18:51:40
|
alex Tue Sep 25 11:21:28 2001 EDT Added files: /r2/binarycloud/user/bcdev/mod/query_example/qry Queries.php Queries.qry.xml Log: Qry Index: r2/binarycloud/user/bcdev/mod/query_example/qry/Queries.php +++ r2/binarycloud/user/bcdev/mod/query_example/qry/Queries.php <?php // ripped from Queries.qry.xml global $QueryManager; $queries = array( array( 'name' => "user.query_example.select.newsbyid", 'sql' => "SELECT newsid, news FROM news WHERE newsid = ?", 'argtypes' => array('integer') ), array( 'name' => "user.query_example.select.allnews", 'sql' => "SELECT newsid, news FROM news" ), ); $QueryManager->LoadQueries($queries); unset($queries); ?> Index: r2/binarycloud/user/bcdev/mod/query_example/qry/Queries.qry.xml +++ r2/binarycloud/user/bcdev/mod/query_example/qry/Queries.qry.xml <?xml version="1.0" ?> <queries> <query> <!-- the name of the query --> <name>user.query_example.select.newsbyid</name> <!-- The SQL portion of the query maybe with placeholders ("?") --> <sql>SELECT newsid, news FROM news WHERE newsid = ?</sql> <!-- Types of the values the ? is going to replaced with. In order of appearance in the sql portion of the query --> <argtypes> <type>integer</type> </argtypes> </query> <!-- Another query without arguments --> <query> <name>user.query_example.select.allnews</name> <sql>SELECT newsid, news FROM news</sql> </query> </queries> |