Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Tony Petroski
Tony Petroski
1,789 Points

Slim Framework - DB?

Hi All

Does anyone have any details on including MySQL connections using slim framework?

Regards,

Tony.

2 Answers

Hi Tony,

There are a few ways to do this - what in particular are you looking to do?

In the meantime, you could take inspiration from github. For instance this person has created a repo for bootstrapped slim framework that uses PDO and MVC. It looks like they've created a 'Model' and thrown all the query/PDO related things into that class. Probably a good place to start :)

Tom

Tony Petroski
Tony Petroski
1,789 Points

Thanks Tom,

Just realized I don't even need the PDO dependency. Got it working with PDO working with slim as it now comes standard with PHP. I'm running v5.5.12.

However, i tried this version previous https://github.com/FaaPz/Slim-PDO but couldn't get it to work so gave up. Thanks for your link.