Uploaded by bixin1999

readme

advertisement
PHP/MySQL Step-by-step
Preparation for doing the project
This document explains how to get the basics of PHP and MySQL working on the servers lent to you by
the CSE department.
STEP 1: Create a table like this in your database:
mysql> select * from users;
+---------+----------+---------+
| lname
| fname
| loginid |
+---------+----------+---------+
| Adam
| Apple
| AXA101 |
| Betty
| Boop
| BXB101 |
| Charlie | Chaplin | CXC101 |
| Debbie | Donohue | DXD101 |
| Ellen
| Eggbert | EXE101 |
| Frank
| Fontaine | FXF101 |
| George | Gorgeous | GXG101 |
| Harry
| Hanlin
| HXH101 |
| Izzy
| Iceland | IXI101 |
| Jerry
| Jarhead | JXJ101 |
| Steven | Shaffer | scs12
|
+---------+----------+---------+
11 rows in set (0.00 sec)
STEP 2: Copy the file start.php. Modify the user name, password and server name as needed.
Upload the edited file to your server in the /var/www/html directory. Do the same thing for
insert.php and delete.php.
Step 3: Making sure that you are still connected to the PSU VPN, start up a browser and navigate to
http://cmpsc431w-s???.vmhost.psu.edu/start.php  replace with your server name. You should see a
screen like this:
STEP 4: Into the "Insert a new user" area, enter Adam Apple AAA123 and click INSERT. You
should see a screen as follows:
Then you will be redirected back to the start.php screen. Note that Adam Apple is now in the list:
STEP 5: Click the DELETE button associated with Charlie
Chaplin. You should see a screen like
this:
After three seconds, the start.php screen will be displayed. Note that Charlie Chaplin is now off
the list.
CONCLUSION: These three files show you how to do basic selects, inserts and deletes of MySQL data
through PHP. You will use this information as a basis for your projects.
Download