From: Andreas A. <a.a...@th...> - 2001-08-18 13:06:52
|
Hi All, Here we go. I checked in a lifted and working version of QueryManager to sourceforge today. Mostly cosmetic fixes, intregration with $Debug, user.conf.datasources and PHPDoc comments. I Also added a additional check for transactions (MetabaseSupport) and made the metabase hack in _ProcessResult more flexible. Metabase: ------------ I had to do a quick hack to the metabase_mysql driver to support _ProcessResult properly (added GetColumnNames($result), to driver). We have to modifiy the other metabase drivers (mSQL,PostgreSQL) too or the QueryManager (as I did in _GetNumCols). But I don't like abstraction there, it's cleaner to have a standard metabase installtion that supports the following functions for fetching column names and count for a executed query (or something similar): MetabaseGetNumCols($database, $result) MetabaseGetColNames($database, $result) This should be no problem. All DBMS as well as PHP support the functionality to archive this - it just has to be done. However for the moment it works for OCI and mysql (with the patch). Init: ------- I had to extent Init to load metabase and QueryManager (hope we did not redundant work, alex?). For a example how to use the swichtches/options see: r2/binarycloud/user/htdocs/query_example.php I also prepared Init to use the request class but that's still commented out. Modules: ---------- I did a really quick demonstration module for a simple custom query. You can find that in r2/binarycloud/user/mod/query_example. How to setup??: ------------------ Now most important the steps to make the query example working. 1: Create a database named "test" (or whatever you like) 2: Install the schema (it requires the db named test) r2/binarycloud/user/mod/query_example/schema.xml or install the sql dumpfile located r2/binarycloud/user/mod/query_example/schema.xml Now you should have a database called "test" a tables called "news". 3: Modify r2/binarycloud/user/conf/datasources.php The first source name is 'query_example'. Change the parameters to fit your setup. 4: run make 5: call query_example.php in your broswer 6: hopefully, smile Andi |