Ok everything is setup here (CVS, etc.) and have checked out a local copy. Just thought I'd chip in an idea:
We should develop a basic framework, which is seperate from all components. This framework handles all the database connections and global options between all the components. Then code all the components to use this framework. Just a suggestion.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2002-08-17
Yes, that will be the next step. This framework will ensure that a valid connection is found to the db, (if not will display an error) based on the conf files.
It will also have a basic function to perform queries (which will of course fix any problems with slashes in queries), and if mysql return an error to the query, it will display an error message.
There are two things to do for a "starting" framework:
1) Create an error framework
- If (PHPWEBMASTERTLS) is defined, display a link with text like "mySQL error" that when clicked shows the full text of the error in an alert().
- If that isnt defined show the whole page.
2) Create a DB framework
- Checks connection according to conf file
- Can perform and return results of queries
- If error in one of above, send request to error framework.
The idea behind the PHPWEBMASTERTLS defined check, is that we will define that on plugins that are included into an existing page (such as polls), so that if an error does occur, it doesn't ruin the look of their whole page.
The error and db frameworks will go under the filenames /lib/error.php and /lib/db.php respectively.
Would you like to start the error one or the db one.
I'll start work on the other one.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry for the delay, SF is really slow for me today. I'd prefer to work on the DBAS, really it will only work for MySQL 3.xx (not too sure about 4) first before I start work on PostgreSQL and MS-SQL db layers though I code the connect / disconnect code for these.
If I'd read this sooner, would have put db in /lib/ however I think it may be better to keep all the db files in a seperate folder, so everything is kept together but we can always move it at a later stage if need be
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2002-08-18
Its ok to keep the DB in separate folder, it makes sense too. This way we can keep all schema information (as well as translations of queries to other DBs) in there.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've been doing some unrelated PHP/DB stuff for a project at work, and I wonder if perhaps it might be smart to use DB::connect to manage database connectivity. Might save us from having to write separate postgresql/mysql headers, and will also allow drop-in support for oracle and db2 among other RDBMS.
Thoughts?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok everything is setup here (CVS, etc.) and have checked out a local copy. Just thought I'd chip in an idea:
We should develop a basic framework, which is seperate from all components. This framework handles all the database connections and global options between all the components. Then code all the components to use this framework. Just a suggestion.
Yes, that will be the next step. This framework will ensure that a valid connection is found to the db, (if not will display an error) based on the conf files.
It will also have a basic function to perform queries (which will of course fix any problems with slashes in queries), and if mysql return an error to the query, it will display an error message.
There are two things to do for a "starting" framework:
1) Create an error framework
- If (PHPWEBMASTERTLS) is defined, display a link with text like "mySQL error" that when clicked shows the full text of the error in an alert().
- If that isnt defined show the whole page.
2) Create a DB framework
- Checks connection according to conf file
- Can perform and return results of queries
- If error in one of above, send request to error framework.
The idea behind the PHPWEBMASTERTLS defined check, is that we will define that on plugins that are included into an existing page (such as polls), so that if an error does occur, it doesn't ruin the look of their whole page.
The error and db frameworks will go under the filenames /lib/error.php and /lib/db.php respectively.
Would you like to start the error one or the db one.
I'll start work on the other one.
Sorry for the delay, SF is really slow for me today. I'd prefer to work on the DBAS, really it will only work for MySQL 3.xx (not too sure about 4) first before I start work on PostgreSQL and MS-SQL db layers though I code the connect / disconnect code for these.
If I'd read this sooner, would have put db in /lib/ however I think it may be better to keep all the db files in a seperate folder, so everything is kept together but we can always move it at a later stage if need be
Its ok to keep the DB in separate folder, it makes sense too. This way we can keep all schema information (as well as translations of queries to other DBs) in there.
I've been doing some unrelated PHP/DB stuff for a project at work, and I wonder if perhaps it might be smart to use DB::connect to manage database connectivity. Might save us from having to write separate postgresql/mysql headers, and will also allow drop-in support for oracle and db2 among other RDBMS.
Thoughts?