PHP communicates to MySQL

PHP Talks to MySQL

February 27th, 2011 in Dynamic Web Development by 0 Comments

Assignment 5: Create a web page that accepts user input and stores it in a table (or tables) in your database. This page should also be able to display the contents of your table(s) in some interesting way. As always, try to choose your data and functionality in some coherent fashion, paying particular attention to user interface design. Why would someone want to use this little application you’ve created? Why is it important that whatever activity they have performed be persistent in your database? On a more technical level, this means that PHP will have to perform at least one SELECT query, at least one INSERT query, possibly an UPDATE query, and possibly a DELETE query. However, the functionality of your interface is ultimately more important than the range of SQL operations it needs to perform.

Response: 9Bit Intro (right click to download to view source code)

About Assignment:

At first I developed a simple page where the user saw all options (create session and join session) while displaying the value of tables in the background. After making sure I had the PHP working, I decided to play with the user interface design and make it a little more web 2.0.

Speaking technically, the page is created and populated via a blend of PHP, MySQL, CSS, CSS3, and HTML. The PHP communicates to MySQL to get information on which users are on what session. On the MySQL side, there are three tables: Users, Sessions, and Users_X_Sessions. In theory I could have just created the first two tables, since Users to Sessions is a one-to-many relationship. The Users table can contain the foreign key which will tell it which session it is associated with. I wanted experience creating foreign key tables, hence the Users_X_sessions table.

Author: ezraezra

I see you looking...

Leave a Reply