Contents

 
Home
PHPRunner 8.0 manual
Prev Page Next Page
 
 

Datasource tables

 

After you successfully connected to database, select all datasource tables you'd like to build PHP code for. After that highlight one of selected tables and step through other screens in PHPRunner adjusting settings for selected table. You can always see name of currently selected table in the middle of blue info pane. To switch between selected tables use Table list pane on the left.

step3

Click Create new Table to add new table to the existing database. Then for each field type name, type, size, scale (applies to DECIMAL datatype in SQL Server, Oracle and MySQL only). Set the Primary key field. Click Create table. Also you can add new custom view, report, chart or dashboard to your project.

step3-1

To edit or delete tables right-click the table name in the list.

step3-3

Toolbar description:

Button

Description

sync_bt

Synchronizes database.

menu_editor_bt

Opens Menu Builder.

arrange_tables_bt

Arranges tables alphabetically.

show_fields_bt

Shows all fields in all tables.

hide_all_fields_bt

Hides all fields in all tables.

change_caption_bt

Opens Label Editor where you can change table captions.

add_relations_bt

Opens Table link properties window where you can add new table relations.

hide_fields_bt

Shows/Hides fields for currently selected table.

create_sql_script_bt

Opens Create SQL script window where you can create SQL script for tables/data transfer to another server.

search_bt2

Searches within table names.

To open context menu of a table/view/chart/report/dashboard, click context_menu_bt near its name or right-click it.

context_menu_table

Change caption option allows to edit caption and field labels. Click Advanced... option to change a base table (is available only for view/chart/report) or filename prefix.

context_menu_adv

Since view, chart and report may include fields from several tables, a base table for them is the table where data is added, edited and deleted. Key columns are also selected from the base table on Choose pages screen.

By default, prefix for each generated file name is the table name. E.g. if the table name is OrderDetails, the file name of List page will be OrderDetails_list.php. If you change the prefix to details, the file name will be details_list.php.

Create custom View

Click Create custom View to create an additional view of the same table. This feature is useful when you like to present several views of the same data.

step3-2

When you create new custom view, all current settings of the table, on the basis of which view is created, are copied into it except for visual templates and events. You can create a copy of existing custom view (right-click the custom view and select Copy). Note that custom views are not created in the database and only exist in the project.

Example:

Table Cars shows all cars in the database. SQL query: Select * from Cars.

View Active listings displays active listings only. SQL Query: Select * from Cars where status='active'

View Closed listings displays closed listings only. SQL Query: Select * from Cars where status='closed'

SQL query can be modified later on SQL query tab in PHPRunner.

Note: when you create a custom view all table settings are copied to Custom view settings.

Synchronize database

Every time you make changes to the database in PHPRunner (e.g. you create new table or view, you add or edit table fields etc.), these changes should be implemented in the database. In other words, the structures of the database and PHPRunner project should be synchronized.

To synchronize database manually, use Sync database button or right-click tables tree or blank area near tables tree and select Sync database.

Also you can use the option to synchronize the database automatically on each project load (select Project -> Settings). Use this option for small or local databases. In the case of remote or large databases the automatic synchronization will take  some time when opening the project.

project_settings1

Renamed/deleted tables

Tables that were renamed in the database (outside PHPRunner) or deleted in PHPRunner are moved to the Deleted tables folder. You can restore table, rename and then restore table, remove table from the project permanently.

deleted_tables

Right-click the Deleted tables to get two more options: Remove all tables and Restore all tables.

deleted_tables_options

Multiple database connections

You can add multiple data sources and mix several database types like MS Access, SQL Server and MySQL in a single PHPRunner project. You can a have master table in MySQL and details table in MS Access. The same applies to lookup tables.

yellowbulbNote: Multiple database connections feature is available only in the Enterprise Edition of PHPRunner. See Editions Comparison.

To add a new database connection:

· click Add connection;
· select database type and connect to the database.

add_connection

The first database connection is considered as "primary" one. But you can make any other connection primary by right-clicking the database name and selecting the corresponding option.

multiple_connections

The following features work only for the primary database connection:

· Add template to project - template will be added only to the primary database;
· Upload to demo account - tables from the primary database will be downloaded to the demo account.

All other features work for all database connections, including Save project as template option.

We do not advise to add tables with the same names that belong to different databases to avoid conflicts.

Converted from CHM to HTML with chm2web Standard 2.85 (unicode)