Connecting to MS SQL via PHP on LAMP

Animated gif of Tina Fey giving herself a high-fiveAfter almost two full weeks of blood, sweat & tears I was finally able to successfully retrieve and display data from a remote MS SQL server from a LAMP via PHP. Tutorial to follow. But in the meantime – SELF HIGH FIVE, yes!

p.s. credit goes to @thesethings for pointing me to that awesome animated GIF!

4 thoughts on “Connecting to MS SQL via PHP on LAMP”

  1. Love to hear more about your integration efforts. We just finished a majorly complicated webapp reporting portal. Pushing and pulling from MS SQL back-end to a Drupal (LAMP) webform front-end. It’s pretty sweet.

  2. Ya know, in the end it wasn’t that complicated (if one knows what they are doing on a LAMP). I’m a dabbler at best, but after failing on local MAMP and a couple of managed virtual servers, I switched to dedicated VPS and pretty much followed these instructions – http://kb.mediatemple.net/questions/233/Using+%28remote%29+MS-SQL+databases+with+PHP+on+a+%28dv%29

    Take care to get the right packages for architecture (MT switched to 64-bit and their own docs and other tuts all assume x86). Using FreeTDS, possibly not the best practice but having MS Dev be responsible for MS SQL performance and logic – asking to get/update what I need from EXEC statements.

    There’s no ADO-ish library I could get working, or anything that would handle multiple record objects in one call, so I’d love to hear about any solutions out there…

  3. Hi Ivan!

    The above comment is about all I’ve got at this point. The site is up and running, another dev has taken over (I moved to new company) and I’ve mentally moved on. In fact, it was painful like childbirth and I think I’ve got trauma-induced amnesia around it! If you run into a specific problem you can hit up @mkarikas from SeattlePHP as he’s had to do a lot of this. Also http://www.freetds.org/is back online now, so that should help with configuration.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>