Debugging tips Home

Introduction
Welcome
System requirements
Licensing details
What is the registration
Using PHPRunner
Working with projects
Templates
What are templates
Cars
Classified ads
Events
Jobs
Knowledge base
News
Paypal
Real estate
Sporting
Vacation houses
Connecting to the database
Datasource tables
SQL query page
About SQL query designer
Query Designer
SQL
Results
Charts
Creating chart and setting parameters
Chart appearance
Using SQL to shape chart data
Reports
Creating report and setting parameters
Report totals and layout
Choose pages
Login page
User login settings
Advanced security settings
User group permissions
Fields order and totals
Miscellaneous settings
Choose theme
Visual Editor
About
Toolbars
Page Elements
"View as" settings
"Edit as" settings
Validation types
Lookup wizard
Events
Output directory settings
After you are done
FTP upload
FrontPage Publishing
Advanced topics
Events
More info about events
Global events
Table events
Page life cycle overview
Predefined actions
Send a simple email
Send an email with new data
Save new data in another table
Insert a record into another table
Check to see if a specific record exists
Display a message on the Web page
Redirect to another page
Custom code
Sample events
Show list of customer orders
Check if start date is ealier than end date
Before deleting a record check for related records
Speed up data entry using events
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
Connect using PHP
Master-details relationships
Using JOIN SQL queries
AJAX-based Functionality
PHPRunner session variables
Debugging tips
Template files processing rules (Files.txt)
Multilanguage support
Useful functions and links
Smarty templates
Stylesheets
Template language
How to control Inline Add/Edit functionality from script
Rich Text Editor plugins
Upgrade Guide from PHPRunner 3.0 and older
PDF view settings
Order PHPRunner online

 
  PHPRunner manual


Debugging tips

 

When your projects do not work as expected, especially when you use a load of events and custom code, you can use the following debugging techniques to resolve the issue.

1. Print all executed SQL statements on the Web page

For this purpose set $dDebug variable in include/dbcommon.php file to true. Especially useful when you need to resolve master-details or advanced security issues.

You can copy SQL query and run it against your database manually to see if it returns correct results. To run SQL query manually use tools that comes with your database (Query designer in MS Access, Enterprise Manager in SQL Server, phpMyAdmin in MySQL).

 

2. Print out variables using echo statement

The echo command is used to write output to a browser. The following example sends the text "Hello World" to the browser:

echo "Hello World";

Here are several examples of how you can use echo command

  • Print variable value

echo "Variable name: " . $variable;

  • In BeforeAdd/BeforeEdit events you can print form field value

echo "field_name: " . $values["field_name"];

  • Displaying Session variable that stores logged in user id

echo "UserID: " . $_SESSION["UserID"];

  • Displaying IP address of logged in user

echo "Your IP address: " . $_SERVER['REMOTE_ADDR'];

 

 

 

The CHM file was converted to HTML by chm2web software.