Tuesday, February 14, 2012

[php] PHP_Incomplete_Class

You've saved an object instance of YourClassName into session. On a subsequent retrieval of this object from session, you discover it's now a __PHP_Incomplete_Class object!

your_object = __PHP_Incomplete_Class Object
(
  [__PHP_Incomplete_Class_Name] => YourClassName
  [id] => 123
  [name] => Fred
)

Check where you're doing the session_start. Chances are you did not include YourClassName (plus any required files of its inheritance chain, if applicable) before starting the session.

Monday, February 13, 2012

[mysql] Opening another result tab in workbench

Even when I have multiple scratch tabs open, MySql Workbench 5.3 always reuses the same "Result (1)" tab for displaying query results. But what if you want to compare the results of two queries?

Click the thumbtack icon at the top right of the Result window ("toggle pinned state of the page") after running the first. Now your next query will be forced to create a second Result tab.

[mysql] Querying column definitions

To list the columns and their definitions, simply run the query:

show columns from your_table_name

[php] Show warnings/errors

I'm always forgetting this.

error_reporting(E_ALL);
ini_set('display_errors', '1');