Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Kirby Foster: "Nice software. Small, lightweight, works well. I evaluated lots of software before deciding that your software worked the best for what I do. Both Maestro for MySQL and PHP Generator have saved me lots of time".
Ran Cole: "We bought the tool last week and want to say how much we love it. We've found it not only powerful, but very user friendly. We have used the tool to create an interface that manages our MySQL DB for different types of users".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

OnCustomDefaultValues

This event allows you to provide a custom default value for a column in the Insert form. Use this event if you need to provide a non-trivial default value for a column (for example, retrieve something from the database or calculate something with PHP code). Live examples.

 

Signature:

function OnCustomDefaultValues($page, &$values, &$handled)

 

Parameters:

$page

An instance of the Page class.

$values

An associative array of default values

$handled

A parameter to indicate whether custom default values should be applied. Set $handled to true to apply the changes.

 

Example

This example shows how to provide the release_date column with the default value "a week later".

 

$release_date = SMDateTime::now();

$release_date->addDays(7);

$values['release_date'] = $release_date;  

$handled = true;



Prev Return to chapter overview Next