|
|
|||||||||
|
|
Tutorial 4Part ISo assuming you have cpanel, log on to your website's cpanel. Click MySQL. Choose a database name (say, 'guests') and save it. This will save as 'siteusername_guests'. Hit 'back.' Now pick a username and password for your Mysql database. These will be saved as 'siteusername_mysqlusername' and 'password'. Hit 'back' again. Now grant your mysqlusername ALL privileges to your database. After saving this, hit 'back' again. Now look for 'php my admin' near the bottom of the page. Part II:Click on 'php my admin'. On your left, you should see an area where databases are listed. You may have to click the arrow to see the name of your 'guests' database. Click your 'guests' database. Now you have two options in creating your database. You can write a text file and import it into your MySQL database. Or you can hit 'structure' and write up your tables right there. I'll cover this second option first. Begin by choosing how many tables and fields you need in your database. To make it simple, I'll use one table, call it 'names' and three fields: 'guestID', 'first_name', and 'last_name'. (If you don't know what a 'table' or a 'field' is, don't worry about it. Just do the tutorial and you'll figure it out.) So fill out the info in the create new table form: table_name is 'names', for 'fields' type '3'. Hit 'go.' A form will appear with headings like 'fields', 'type', 'length/value', etc. Under 'fields' fill in the names of your three fields: 'guestID', 'first_name', and 'last_name'. Next fill in the 'type' of each field - the default is 'varchar' (variable characters - could be numbers and/or letters, or other characters). 'Varchar' will do for first_name and last_name because the fields will be all letters and other characters. But the 'guestID' field is meant to give you quick access to a specific name. The quickest way to access something is with a number, so make the 'guestID' field 'type' a number or integer - hit the 'type' arrow and click 'int'. (If the words seem confusing, I'll make it simple. All you have to do is: get your form to match figure 1 below.) Figure 1: You can use the defaults on the rest of the form, except for the last five items on the far right of the form. On the fifth small category from the end, there's a key. Click underneath the key for your 'guestID' field only. Leave everything else as is. This will make your 'guestID' a key, or index, to use for quick access. Your IP address is: 38.103.63.17 |