It seems a good idea, please give me time to think about it. I go to mountain this weekend (I am just shutting down the computer :-) ), when I come back I will respond you.
El Viernes 17 Junio 2005 14:28, Dan Langille escribió: > On 17 Jun 2005 at 14:18, Juan Luis Frances wrote: > > Hello Dan, > > > > > Will there be different SQL for each supported database? > > > > Yes. One example: > > > > if ( $dbSql->driver == "pgsql") > > $query = ""; > > OK, what about something like this. Set up all your SQL in one > place. > > $queries[STUFF_FROM_TABLE1][POSTGRESQL] = 'select...'; > $queries[STUFF_FROM_TABLE1][MYSQL] = 'select...'; > > Then, when you need a query, it's like this: > > $query = $queries[STUFF_FROM_TABLE1][SELECTED_DRIVER]; > > But, hat doesn't work very well if you have parameters.... > > Hmmm, we could use a sprintf for parmeters. For example: > > $format = "There are %d monkeys in the %s"; > printf($format, $num, $location); > > So the code becomes: > > $query = $queries[STUFF_FROM_TABLE1][SELECTED_DRIVER]; > $query = sprintf($query, $parameter1, $parameter2); ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click _______________________________________________ Bacula-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bacula-users
