News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Richard Thomas' Blog:
Solar Framework Shorts - Table creation
September 18, 2009 @ 11:49:29

On his PHPJack blog Richard Thomas has posted a quick entry (with a handy code snippet) using the auto-create functionality the Solar framework includes.

One of the nice things about the Solar Framework is the ability to define table layout within the models.. Its not something you have to do but when you do Solar will auto create the table if it does not exist. [...] Auto create however has 2 issues.. 1. Pre populating data, 2. Table settings outside of Solar's realm (like temp tables). This however is really easy to solve by extending Solar.

His code sets up a custom model that loads in a SQL file and executes it into the database you've set up. Each line is split and looped through to ensure that those databases without multiple query support will still cooperate.

0 comments voice your opinion now!
table create solar framework


blog comments powered by Disqus

Similar Posts

PHP F1: PHP Session Tutorial

DevShed: An Introduction to Simulating the Model-View-Controller Schema in PHP

The Bakery: Clearing Up Some Confusion on the Release Versions of CakePHP

Symfony Blog: The Definitive Guide to Symfony and symfony 1.0 RC1 released

Debuggable Blog: How to Group By in CakePHP's new release Part 2


Community Events





Don't see your event here?
Let us know!


interview wordpress series developer api configure podcast community application language code bugfix threedevsandamaybe list library laravel introduction install symfony release

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework