Contents

 
Home
PHPRunner 7.1 manual
Prev Page Next Page
 
 

Datasource tables

 

Choosing datasource tables and views to build PHP code

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 Add Table to add new table to existing database.

step3-1

For each field type name, type, size, scale (applies to DECIMAL datatype in SQL Server, Oracle and MySQL only). Set the Primary key field.

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 the table context menu, click context_menu_bt near the table name. Change caption option allows to edit table and field labels. Click Advanced... option to change the filename prefix. By default, the 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.

Add Custom view

This feature creates an additional view of the same table. This feature is useful when you like to present several views of the same data. 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.

step3-2

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

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