Adding Extra Fields
PedigreePoint supports user definable fields in addition to the default
fields. Basically the display of
extra fields in all reports, including the search page is automatic. You simply
need to add the extra fields to the
MySQL table. PedigreePoint detects the extra fields and uses the field name when
displaying the data.
Hence if you add a field called "Owner" then if that field contains
say "Mrs Brown" then it will be displayed as
"Owner= Mrs Brown".
| (1) Change table schema | The first step is to modify the schema of your
MySQL pedigree table. You can do this by login to your PHP MySQL admin
console as described here. The
in the SQL tab paste the following command
alter table `pedigree` ,add column `Owner` varchar (64) NULL; but modify it first by replacing Owner with the name of the column you are adding and replace 64 with the size of the field. Since MySQL only allocates as much storage as is required to hold the data, allocating a field size of 64 is just as efficient as allocating 8. Note that any field names you use in MySQL must not have any spaces in the name - this is a limitation of the PERL scripts we use, not MySQL |
| (2) Modify export expression | The normal export string used in BreedMate is:
%2, '[Name]', %3, %4, '[Sex]', '[DOB%1]', '[Titles]', '[Obedience]', '[Reg No.]', '[Colour]', '[Photo]' Note that it has 11 fields. If we had added two fields as described above called Owner and Breeder the export string would have to be modified to: %2, '[Name]', %3, %4, '[Sex]', '[DOB%1]', '[Titles]', '[Obedience]', '[Reg No.]', '[Colour]', '[Photo]','[Owner]','[Breeder]' Note that the name in square brackets must be the exact name of a field in your BreedMate database (not MySQL) and if it is anything except a number it should be enclosed in single quotes. |
| (3) Modify pp_search.htm | This is an optional step. If you would like
users to be able to search on any extra fields you add, you should modify
the HTML code in the file pp_search.htm as described
in .How to set search fields |
| Its that easy! After exporting to MySQL the extra fields will be displayed for any entry if that field contains data. |