Creating a MySQL Database with PHPMyAdmin

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.

Screenshots forthcoming

Create the Database

  1. 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.
  2. Name the database and click Create Database.
  3. 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.

  1. Back in cPanel, click PHPmyAdmin.
  2. Under the Databases tab, click the name of the new database (characters).
  3. Enter the Name under Create Table (it took me far too long than it should have to settle on “character_info”)
  4. 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).
  5. Click Go.
  6. 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.”
  7. Click Save.

My Future Form Fields

  • Character Name
  • Class
  • Level
  • Race
  • Alignment
  • Experience Points
  • Hit Point Maximum
  • Strength
  • Dexterity
  • Constitution
  • Intelligence
  • Wisdom
  • Charisma
  • Gold Pieces
  • Silver Pieces
  • Copper Pieces

 

Advertisements

About jotascript

Aiming to please. Seeking to impress.
This entry was posted in MySQL, PHP. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s