- Using POG with Flex
- Optimizing your web application
- Regenerating large objects
- PHP4 or PHP5
- New and Improved
- Evolution of a cube
- POG Museum
- POG 3.0 alpha
- Initial Performance results Part 2
- Initial performance results
- Proposal: POG 3.0 object model
- Suggest a feature
- A new year, A new POG release
- Many-Many relations
- POG 2.5 Released
- POG 2.5 beta
- Automatic table alignment
- New version: 2.1.2 released
- RSS should work well now
- RSS feed glitches
- What's new in 2.1.0
- PHP Objects 2.1.0 (preview)
- PHP Object relations FAQ
- PHP Object Relations
- Searching base64 encoded text
- How to debug POG-generated objects
- POG UI Tips
- Featuring Of Interest links
- PHP CRUD
- POG 2.0.1: A better code generator
- A look at the POG SOAP API
- POG 2.0.0 released
- Coming soon: Generate parent-child objects
- Generated abstraction v/s dynamic abstraction
- Zend Framework preview
- Coming soon: Generate Objects through SOAP
- Easily save images and files to a database
- PHP, Paypal & POG
- Five advanced Code Generator tips
- PHP Pagination using generated objects
- PHP Code Generator benchmarks
- Representing database objects using an AJAX Tree interface
- Using SETUP in a production environment
- Description of the generated object package
- Introducing PHP Object Generator version 1.6
- Using AJAX and PHP Object Generator
- When to use Object->SaveNew()
- Generating PHP objects in 2006
- Happy Holidays
- A short video of the POG Setup process
- A sneak peek at POG 1.6
- POG Tip: Field limits
- Previous versions.
- Searching the blog and tutorials sections
- Generating code with "Other" SQL data types
- Five general POG tips
- POG source code locations
- Microsoft SQL 2005 Express Edition
- Impatiently awaiting PHP 5.1 and PDO
- Php Object Generator goes open source
- POG generates PDO compatible code
- Oracle to offer free database
- POG Google group
- Database Wrappers and POG
- The generator blog
- An explanation of the 'Escape' function.
- Mirror, mirror
- Using POG to solve real world problems
- A php object-relational database tool
- A simple and flexible Object Oriented approach to PHP
Back to the Code Generator
The POG Google group
The POG tutorials/code samples
The POG mirror site
Sometimes, while working with POG generated PHP objects, you might get unexpected results. Here’s a short cheatsheet that should help you diagnose and solve your issue(s) quickly:
Verify Object validity
Check that the object generated is valid by loading it into a PHP editor. If there are any syntax errors, it will show up. In extremely rare cases, POG might generate invalid PHP objects. For instance, If your object doesn’t have an appropriate name or attributes (e.g. object name which starts with a Number instead of an Alphabetical character).
POG Setup’s main purpose is to automate table creation (if necessary), perform unit testing and provide a light scaffolding environment for your objects. Each time setup is run, all the objects present in the /objects folder are tested and verified to make sure that all 5 CRUD methods are working correctly. This is a quick way to determine whether or not any change you made to the object is causing you trouble.
POG Setup Failure?
If you encounter any fatal issues during POG setup, POG will prevent you from proceeding. The issues in the “fatal” category include:
- Table not properly created
- Mismatch between POG Object and Existing table.
In the first case, simply copy the SQL from the object header and try to execute it on your database. If there are issues with the SQL statement, you’ll be able to see it right away.
In the second case, drop any existing table and let POG try to recreate it.
Including all necessary files
Did you include all the necessary files at the beginning of your PHP file?
- class.database.php (PHP 4 and PHP 5 objects only)
- object files themselves
Echoing out sql queries
Until we find the time to implement a debug setting, you can easily see what query POG is issuing to the database by echoing out the $pog_query variable within any object. For instance, let’s say you have a Save() statement in your code but nothing is happening on the database level, i.e. no records are being created. Simply put an echo command in front of the $pog_query variable in the Save() method of your object. This will echo out the query just before it is dispatched to the database and you’ll most probably find why the query is invalid immediately.
Sometimes, you just want to see what’s the internal state of your object, whether it’s after you go a Get() or Save(). You can easily print out the contents of your php object by using print_r
The POG documentation outlines the essential things you should know before using POG. We’ve also create some documentation summary in PDF format that you can download and read at your leisure.
Ask for help
Head to the POG Google group and search the archive for similar issues that have been solved. More often than not, your questions have already been answered previously. If not, feel free to post your issue. We’ll get back to you ASAP
Other common issues
Other issues commonly encountered when dealing with PHP Database objects are:
- serialization issues while using PHP objects and Session variables
- data related issue (e.g null values in database)
Hopefully, this will help reduce your debugging time to a minimum while dealing with POG objects.
This is a weblog about the Php Object Generator (POG) project, OO PHP, databases and Php code generators in general.
Php Object Generator, (POG) is an open source PHP code generator which automatically generates clean & tested Object Oriented code for your PHP4/PHP5 application.
Subscribe to our RSS feed
Feedback, Feature Requests, Bugs to:
The POG Google group
Send us a Hello through email