> Determine which database driver is being used http://api.cakephp.org/class/model#method-ModelgetDataSource
As for your custom query, it really depends. Cake does a lot for you, but sometimes it makes sense to drop down to the bare metal and write a custom query. -j. On May 28, 12:46 pm, blake <[email protected]> wrote: > Hello, > > Not sure if this has been discussed before, but I couldn't find it. As > much as I hate to do it, I think I may need to use my first custom > query out of this entire website (either that or use a recursive > search, which is running thousands of queries instead of just 1). > > My biggest issue with a custom query is that for my local development > machine, I use MySQL and the production server uses MS SQL (not my > choice). Obviously a custom query won't work when copying code between > these two, so I wanted to try coding something like: > > if ($database_driver == 'mssql') { > $query = 'select....';} > > elseif ($database_driver == 'mysql') { > $query = 'select....'; > > } > > I'm open to suggestions if there's a way to avoid a custom query here, > but if not, is there at least a good way I can determine which DB > driver is being used so I can do something similar to the above? > > Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
