I need forms for, among other things, users to enter character information but that information also needs a home after leaving the form so, first, I’ll create a database using MySQL. MySQL is free as is PHPMyAdmin, the handy interface for using MySQL. Whether you make the form or the database first is up to you–just decide on the field names beforehand.
Even the least expensive hosts worth anything at all have both available. Even a free host should. Don’t even use a free host if it doesn’t include these and certainly don’t pay for hosting that charges you per database or anything close to such nonsense.
Jay’s Tip: Avoid GoDaddy unless they’re having some ridiculously awesome sale on domain names. Their hosting is lame.
Create the Database
- In my host’s cPanel (never, ever pay for hosting without a cPanel which is a dashboard or control panel for all your shizzle), I click MySQL Databases. You can’t create the databases in phpMyAdmin–just manage and edit them.
- Name the database and click Create Database.
- Click Go Back (if you want–you can also just close the tab or window).
Create Tables in the Database
While a database can be/contain a single table, they often don’t (see my All About Databases video). Even if I only use one, single, simple table for Characters, I still need to create that one, single table in my database.
- Back in cPanel, click PHPmyAdmin.
- Under the Databases tab, click the name of the new database (characters).
- Enter the Name under Create Table (it took me far too long than it should have to settle on “character_info”)
- Enter the Number of Columns which is, for my purpose at the moment, the number of fields in the form based on the basic information I want to capture (listed below).
- Click Go.
- Enter a Name for each column–no spaces or other crazy shizzle–and choose a Type. I chose Text for fields in which users type their character name, for example. Text is also suitable for menus from which users select a class or alignment. I chose INT (integer) for fields in which either users enter a number or my future dice-rolling (random number generating) code will place a “die-roll.”
- Click Save.
My Future Form Fields
- Character Name
- Experience Points
- Hit Point Maximum
- Gold Pieces
- Silver Pieces
- Copper Pieces