Hi Fred
Ok, I can add a "Year" column to the table but I don't see how it could solve my problem ... ! Please give more details.
Use two dropdown menus: one for the years and one for the months.
In this case you use one DB table, but you will be able to sort and filter by year and by month.
You could save into different tables by using a few of the
Actions Custom Server Side Validation and nesting them.
Add this code to the first
Custom Server Side Validation:
<?php
$year = $_POST[year];
if ($year == 2013) {
return true;
}
else {
return false;
}
?>
(assuming your dropdown is named
year and the option values are
2013,
2014 and so on - you will need to change them to match your values)
Add the
Action DB Save into the
On Success. There you select your 2013 database table.
Drag and drop another
Custom Serve Side Validation into the
On Fail.
Then repeat above steps.
But this time, add the following code to your (2nd)
Custom Server Side Validation:
<?php
$year = $_POST[year];
if ($year == 2014) {
return true;
}
else {
return false;
}
?>
And select your 2014 database table in the
Action DB Save here.
And so on…
Please note:
I don’t know how good above solution is regarding the performance.
And you must make sure, the user must select a proper value from the dropdown. One its value matches the PHP Code (example
$year == 2014).
And of course above solution is not really good if you have many entries in your dropdown…
Maybe better way would be as Bob suggested by using the
Action Custom Code and writing the process with proper PHP there. I guess it depends on the number of entries in your dropdown and I guess you will have many...
Patrick