
MySQL and PHP MyAdmin
[ go back ]
Please excuse this site. It was written by tech people. Our developers will make it look nice at a future time.
| Before
you get started please be advised. If you have no experience
working with MySQL or PHP you should consult with a developer or visit
your local bookstore. Rapidsystem will provide technical support for the
operation of these products. However, we can't provide training or
development support. This sample is provided only to demonstrate
one approach to using this interface. To learn more about MySQL
please visit http://www.mysql.com/documentation/
If you have requested a MySQL database we create an empty database using your account login information. The database is empty because we have no idea what type of information you want to store. In this example we have small database called "myusers" where we want to store the name, email address and job function of each user. We login to the interface and we see our empty database. We need to create a table to hold our data.
As shown above we create a table called users with 3 fields in it. The 3 fields are for Name, Email address, and Job. We click the Go button.
We assign our 3 fields. Each is a character field. We assign a length that we feel will be more than long enough to hold any record. Note that we selected VARCHAR for the field type and "not null". This means that the field can't be left blank and the field will contain Variable Characters. There are other options for the fields that might be more useful for what you are tying to accomplish.
Scrolling to the right we set the option
to make the first field "Name" the key field we want to search
on. A key field is what allows to to look up records in a table.
When done we click the save key. (shown in previous screen)
The screen above shows that our table
has been created. You can do many things from this interface
including using direct SQL statements on your database. Many screens
have links to help. Now we have to create some PHP code that will reside inside our webpage to talk to our database. In this example // means that it is a comment about what the code is doing. Below we tell it to connect to the local server and enter our user ID and password. We also tell it what database to use. In this case it's "myusers" //connect to server and choose database Sample code to insert or delete a record //the user has hit either the update or delete button. //this is a new row an must be inserted
|
[ go back ]