Contents

Introduction
Welcome
System requirements
Licensing details
What is the registration
Quick start guide
Using PHPRunner
Working with projects
Navigation bar
Templates
What are templates
Cars
Classified ads
Events
Jobs
Knowledge base
News
Paypal
Real estate
Sporting
Vacation houses
Connecting to the database
Datasource tables
Master-detail relationship between tables
SQL query page
About SQL query designer
Query Designer
SQL
Results
Charts
Creating chart
Chart parameters
Chart appearance
Using SQL to shape chart data
Reports
Creating report and setting parameters
Report totals and layout
Choose pages
Choose fields
Fields order and totals
Miscellaneous settings
Security
Login page
User login settings
Advanced security settings
User group permissions
Dynamic Permissions
Choose theme
Visual Editor
About
Toolbars
Page Elements
Adding PHP code snippet
"View as" settings
"View as" settings: Custom
"Edit as" settings
Validation types
Lookup wizard
Menu builder
Events
Output directory settings
After you are done
FTP upload
FrontPage Publishing
Advanced topics
Events
Predefined actions
Send a simple email
Send an email with new data
Send an email with old data
Save new data in another table
Save old data in another table
Insert a record into another table
Check if a specific record exists
Display a message on the Web page
Redirect to another page
Sample events
Appearance
Add dropdown list box with values for search
Add foldable section
Change cell background color
Change row background color
Disable record editing
Hide controls on Add/Edit pages, based on logged user name
Redirect to details page after master record was added
Show data from master table on detail view/edit/add page
Show pop-up window
Make search button return data only when search value was entered
Database
Before deleting a record check for related records
Select multiple values from checkboxes or a list field and have them appear as individual database entries
Show list of customer orders
Update multiple records on the List page
Update multiple tables
Dynamic SQL query
Record locking
Email
Email selected records
Send an email with updated fields only
Send mass email to all users
Upload
Check size and extension of uploaded files
Rename uploaded files
Upload files to users folders
Misc
Check if start date is ealier than end date
Speed up data entry using events
Save user data in session variables
Implementing 'single sign on' feature
Redirect to user info edit page
Global events
Login page
Before process
Before login
After successful login
After unsuccessful login
Before display
Menu page
Before process
Before display
Register page
Before process
Before registration
After successful registration
After unsuccessful registration
Before display
Change password page
Before process
Before change password
After password changed
Before display
Remind password page
Before process
Before password reminder sent
After password reminder sent
Before display
After application initialized
Table events
Add page
Before process
Before record added
After record added
Before display
Copy page
OnLoad
Edit page
Before process
Before record updated
After record updated
Before SQL query
Before display
List page
Before process
Before record deleted
After record deleted
After group of records deleted
Before SQL query
Before record processed
After record processed
Before display
Printer-friendly page
Before process
Before SQL query
Before record processed
After record processed
Before display
View page
Before process
Before SQL query
Before display
Search page
Before process
Before display
Export page
Before process
Before SQL query
After table initialized
Page life cycle overview
Programming topics
Data Access Layer
Debugging tips
How to control Inline Add/Edit functionality from script
Master-details relationships
PHPRunner session variables
PHPRunner templates
runner_mail function
Template files processing rules (Files.txt)
Template language
Using JOIN SQL queries
Useful links
Publishing PHP application to the remote Web server
Using FTP client to publish PHP pages to the remote Web server
Using FrontPage to publish PHP pages to the remote Web server
Demo Account
What is the Demo Account?
Terms and Conditions
Enterprise Edition
Online report/chart builder
Online report/chart builder v2.0 - Installation notes
Creating web report
Creating web chart
Domain host instructions
Yahoo!
Connecting to MySQL
Configuring FTP
Publishing project via FTP
1&1
Connecting to MySQL
Configuring FTP
Publishing project via FTP
GoDaddy.com
Connecting to MySQL
Configuring FTP
Publishing project via FTP
WebHost4Life.com
Connecting to MySQL
Configuring FTP
Publishing project via FTP
MyHosting.com
Connecting to MySQL
Configuring FTP
Publishing project via FTP
InspiRunner.com
Connecting to MySQL
Configuring FTP
Publishing project via FTP
How to install local web server (XAMPP)
Connect using PHP
AJAX-based Functionality
Multilanguage support
Stylesheets
Rich Text Editor plugins
PDF view settings
Order PHPRunner online

 
Home
PHPRunner 5.1 manual
Prev Page Next Page
 
 

Show data from master table on detail view/edit/add page

 

Show data from master table on detail view/edit/add page.

To add this event use (Insert PHP code snippet) button on the Visual Editor page.

Note: Change the values listed in red to match your specific needs.

global $dal, $strTableName;
echo "Master Info<br>";
if ($_SESSION[$strTableName."_masterkey1"])
{
$rs = $dal->MasterTableName->Query("Masterkey=".$_SESSION[$strTableName."_masterkey1"],"");
if ($data = db_fetch_array($rs))
{
echo "Field1: ".$data["Field1"]."<br>";
echo "Field2: ".$data["Field2"]."<br>";
}
}

For example, Orders is a master table, while Order details is a details.

global $dal, $strTableName;
echo "Order Info<br>";
if ($_SESSION[$strTableName."_masterkey1"])
{
$rs = $dal->Orders->Query("OrderID=".$_SESSION[$strTableName."_masterkey1"],"");
if ($data = db_fetch_array($rs))
{
echo "Customer: ".$data["CustomerID"]."<br>";
echo "Employee: ".$data["EmployeeID"]."<br>";
}
}

 

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