[thelist] DB Schema Design

Will Davidson will at webfellow.net
Sun May 7 18:07:38 CDT 2006

On 5/7/06, Hassan Schroeder <hassan at webtuitive.com> wrote:
> Matt Warden wrote:

> just feels like a potential maintainability problem to me, and I see
> nothing to gain from it. But perhaps this is a unique situation. :-)

On the contrary, this is very easy to maintain ... each function will be
defined as roughly the same database query (might as well reuse code) with a
different variable based on the function call, see the below example in
php.  Esentially you can find results for any entry put in the status
field.  The reason this makes more sense is it consolidates your
information, which is all similar.  There just isn't a good reason to
seperate the information when PHP does this much more efficiently.

function GetStatus($statusid){
     $sql = 'SELECT * FROM Status WHERE StatusID = '" . $statusid . '"';

Call the function GetStatus("CustomerStatus"), or
GetStatus("ShippingStatus"), etc or put inside the parans whatever you have
in StatusID field for values.  You can now get results for any status
type/id/class anywhere in the site.  It allows for much less programming and
data manipulation overhead.

Will Davidson
will at webfellow.net

More information about the thelist mailing list