This topic is locked

sub-set of a table

7/21/2005 2:47:26 PM
PHPRunner General questions
roy author

I have an app generated for a database that contains (among others) the following tables; businesses, contacts, contracts. The business table is the master table to the detail tables: contacts and contracts. The businesses are coded with status codes A=advertisers, F=former advertiser, D=defunct, and P=prospect.
In the current app I have a WHERE clause in the businesses table "Edit SQL query" screen excluding the prospects (!='P'). I would like to have another menu item which would include only the prospects (='P'). I would prefer not to have the sales staff creating the sub-set using the search bar. I'm looking for the menu selection equivalent of searching for "Status Equals P".
In all other respects, it would be treated the same as all the other businesses. With the possible exception of eliminating the master-detail relationship to contracts, since they won't have any contracts as long as they remain a prospect.
Is this possible? If so, how might I implement this?
Thanks,

Roy

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=1659&image=1&table=forumtopics' class='bbc_emoticon' alt=':unsure:' />

Sergey Kornilov admin 7/22/2005

Hi,
current PHPRunner version allows to generate only one PHP pages set for one table.
Here is what you can do:
Create a table Businesses1in your database with the same structure as the Businesses.
Add Businesses1table to your project and modify SQL queries for Businessesand Businesses1tables as you need.
I.e. add Where status<>'P' to Businessestable SQL and Where status='P' to Busineses1.

Build the project.
Then open Businesses1_variables.php file, find this lines

$strTableName="`Businesses1`";

....

$gstrSQL = "select  .... From `Businesses1`";



and replace businesses1with businesses.
Now Businesses... and Businesses1... pages point to the same table.