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 Comments »

  1. Henry H said,

    March 30, 2011 @ 5:58 am

    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. mahalie said,

    July 13, 2011 @ 4:51 pm

    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. Ivan Storck said,

    July 22, 2011 @ 3:16 pm

    I may have to do this soon, too. Would love to hear more about the stumbling points and successful methods!

  4. mahalie said,

    July 29, 2011 @ 12:32 pm

    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.

RSS feed for comments on this post · TrackBack URI

Leave a Comment