Valid XHTML 1.0 Strict
PHP MySQL Web Database Application Generator Reduced from $195 to $49.95 for a limited period only!

GUIDED TOUR - PART THREE - choosing editors in:
PHP/MySQL Web Database Application Code Generator Version 10

There are many different types of editors for different types of fields. This is a summary of what each editor does, and when to use it.

  1. Standard Text Box
    Text Field Editor
    Editor Type: Text     Properties -> Type: Standard Text Box

    The Standard Text Box is a simple, familiar text editor.

  2. Auto-Complete
    Auto-Complete Field Editor
    Editor Type: Text or Number (Integer)     Properties -> Type: Auto-Complete

    The Auto-Complete editor uses Ajax calls to display matching suggestions as you type. When the users sees the value they want, they simply click on it instead of having to type it in full.

    The suggestions are populated from another table in the database, defined under Table to Lookup.

  3. Upload Fields
    Upload File Field Editor
    Editor Type: Text or Binary (Upload)     Properties -> Type: Upload File

    Upload Image Field Editor
    Editor Type: Text or Binary (Upload)     Properties -> Type: Upload Image

    You can upload images and files, and either store them on the file system, with the filename being stored in a text field, or the file can be stored in a blob (Binary Large Object) field.

    Most people recommend storing files on the file system, the ability to store files in the database is only included for completeness.

    Image uploads display the image, whilst files are represented by an icon graphic – the user can click on it to download it.

  4. Search-Form Lookup
    Search Form Field Editor
    Search Form Field Editor
    Editor Type: Text or Number (Integer)     Properties -> Type: Search Form

    The Search-Form field looks like a dropdown list, but when the user clicks on the arrow, it brings up a filterable search form to help the user locate the record they want.

    This is particularly useful for customer tables for example. If you have 10,000 customers you don’t want to list them all in a drop down list! Using a Search-Form would allow the user to search by First Name, Second Name, Post/Zip Code etc.

  5. Password Field
    Password Field Editor
    Editor Type: Text     Properties -> Type: Password

    If you have a table of user records in your database which is used to authenticate users then it is a good idea to set the password field to the password editor. This will ensure that the actual password is not displayed (dots will be shown instead) and the user will be prompted a second time to confirm their choice of password.

    You can choose to encrypt the password using either ther SHA1 or MD5 functions. These encrypt the password so that if a hacker gained access to your database, they could not guess the password just from seeing the stored value.

    Hackers also use databases of common passwords encrypted so that they can possibly work out the password from the encrypted value. Therefore, you can add a salt value to the field before it is encrypted. The Salt is a random phrase or characters – keep it secret to keep your database secure.

    Incidentally, the number of dots in the password field do not reflect the number of characters in the actual password entered. Since it has been encrypted, the value held will always be the same length. If you view source you will see that the value held is “UNCHANGED”.

  6. Integer / Decimal Field
    Integer / Decimal Field Editor
    Editor Type: Number (Integer)
    Editor Type: Number (Decimal)

    The integer and decimal fields uses a javascript function to prevent the user from entering alphabetic characters. The decimal version allows you to specify the number of decimal places.

  7. Dropdown List Field
    Dropdown List Field Editor
    Editor Type: Dropdown List

    The dropdown list field can be populated from a database table, or from a hard-coded list of values which is held in an XML file.

  8. Radio Button Field
    Dropdown List Field Editor
    Dropdown List Field Editor
    Editor Type: Radio Button

    The Radio Button editor shows the list of options specified in a hard-coded list of values which is held in an XML file.

  9. Large Text Field (HTML)
    HTML Large Text Field Editor
    Editor Type: Large Text     Properties -> Use HTML Editor: Ticked

    Large Text Field (Plain Text)
    Plain Large Text Field Editor
    Editor Type: Large Text     Properties -> Use HTML Editor: Un-ticked

    The Large Text editors are used for text fields in the database and allow large quantities of text to be edited.

    You have a choice of plain-text or HTML Editor – which links into the FCKEditor open source Rich Text Editor which contains facilities to change typeface, size, colour etc.

    Please Note: FCKEditor is not part of PHP/MySQL Web Database Application Code Generator, it is supported for convenience. If you have any problems with the editor then please check the forums at http://www.fckeditor.com

  10. Date Field (Calendar)
    Date Field (Calendar) Editor
    Editor Type: Date/Time

    The date editor allows the user to type the date and/or select it from a pop up calendar. It looks at the end users browser country settings and displays the date month and year in the appropriate order for that country.

  11. Checkbox Field
    Checkbox Editor
    Editor Type: Checkbox

    The Checkbox field is useful for true/false (tinyint) values.

  12. Dual List Field
    Dual List Editor
    Editor Type: Dualist

    Dual List Editors allow you to handle many-to-many relationships.

    For example, in our demonstration DVD database, we want to record the languages available on the DVD – but a normal dropdown list isn’t any good because DVDs often have more than 1 language soundtrack.

    The DualList shows all the available values on the left, and the selected ones on the right, with buttons to transfer values between the lists.

    When there are too many “available” options to show them all, there is an option to combine it with auto-complete so that the user types in a few letters from the value they want and a list of matching options will be shown.

    How does it work?

    To associate multiple lookup values in this way, we need a “middle” table – a table that is simply used to link the other 2 tables.

    In our example database, we have a table of DVD records called tbldvd, with an identity field called dvdid. There is a language table called tbllanguage with an identity field called languageid. The middle or link table is called lnkdvdlanguage and contains the fields dvdid and languageid.

    It may sound complicated if you don’t have a lot of experience with databases, but it’s really quite easy once you get your head around it!

Continue to Guided Tour Part 4 - How to Create a DualList Field