From: Ajay P. <ap...@ve...> - 2004-03-12 02:58:18
|
Dear Matthew, I have subscribed to this list but it is my first time to post a message. I am sorry for not making any useful contribution towards PhpESP. I have a suggestion about the switch for SQL calls for different DBS. Perhaps, we can define all SQL calls in an properties file (or XML). Example: SQL_Queries.properties. ADD_QUESTION_SQL = "INSERT ...." DELETE_QUESTION_SQL = "DELETE ..." The application can read the SQL queries needed from the property file. $sql = getSQL("ADD_QUESTION_SQL"); This approach is similar to internationalization. We can keep a separate file for each target database. I wonder if others have a better idea. Ajay ----------------------------------------------------------------- 差出人 Matthew Gregg <gr...@mu...> 送信日時 2004年3月12日 (金) 午前 11:14 宛先 phpESP-devel <php...@li...> 件名 [phpesp-dev] adodb port question. I've been slowly converting ESP over to us the ADODB[1] library targeting mysql, postgres and sqlite as supported DB's. I had hoped that adodb would provide enough DB abstraction that it would be possible to do the port just by replacing the native php mysql functions and SQL bits, with adodb equivalents. I have approximately 99% working in mysql, 70% sqlite, 10% postgres and it appears that to get all the DB's working I will need to replace all/most SQL calls with a function that implements a switch based on the current DB and returns SQL appropriate for it. So my question is.. does this sound like the path I should take? Other suggestions? |