How TO Use MSSQL views in PHP ?????

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
sacfreak
Forum Newbie
Posts: 6
Joined: Tue Mar 11, 2003 3:10 am

How TO Use MSSQL views in PHP ?????

Post by sacfreak »

hi,
i want to know how to use mssql views in MSSQL and especially pass parameters.....so that only specific results can be extracted.
Please help..
fractalvibes
Forum Contributor
Posts: 335
Joined: Thu Sep 26, 2002 6:14 pm
Location: Waco, Texas

Post by fractalvibes »

In my experiences ( not with MS SQL though), a view is treated exactly like a table as far as the developer is concerned.

Say you had a table of members of some organization, they have various statuses, active, inactive, delinquent, what not. Say some of these members subscribe to some different services; publications, insurance, special widget service, whatever.

If warrented, you could create a view such that it contained only active members who subscribe to ABC service. You can write parameterized SQL queries against that view and give any other conditions needed. Just like any other table. A view is simply a subset of 1 or more tables, defined by the SQL that created the view.

Phil J.
Post Reply