Sunday, February 22, 2009

Ch. 3 cont.

Instead of downloading the software to run a local server and database on my system, I've decided to just buy web space and a domain to practice my PHP and MySQL skills. I purchased the domain ugalambdas.org from Yahoo! domains and 100MB in web space from Xfluro.com hosting site.

The site is still under construction but I have a rough draft of it currently up (www.ugalambdas.org/index2.html). I will used what I learned during this semester to improve my fraternity's website.

Things Learned:
DROP command in SQL completely delete your table
DESCRIBE command analyzes the structure of your table and it's data types
mysqli_fetch_array() fetches query results into an array
WHILE Loop is used to repeat certain code when set condition is true
DELETE command can either delete all or delete only specific things if written correctly


This chapter shown me how to add and remove things from a database using a web browser and PHP scripts.

Wednesday, February 18, 2009

Ch. 3 - create and populate a database

The example in chapter 3 discussed making a database and using it to email a mass message to every person in the database.

Things Learned:
-Data in database needs to be define
-Text data type takes up the most memory to store
-VARCHAR is for data type that might not have a exact number of characters
-CHAR is for data type that you know will have an exact number of characters

I am still working through the chapter. Also, I am still trying to set up my computer to run a local server and MySQL so that I can perform the given examples.

Thursday, February 12, 2009

Chapter 2 - Finish

The functions in PHP to connect to a database and add data to it is very similar to what I've learned in 4630 with the MVC model.

mysqli_connect() - this function opens a connection between the PHP script and MySQL server so they can communicate. There are 4 important information that is needed to connect to the server database: locati0n of the database, username, password, and database name
mysqli_close() - this closes the connection to the database
mysqli_query() - this function executes the sql statement contains within the PHP code

Wednesday, February 11, 2009

Chapter 2 --- Trouble

I followed appendix ii in the book to try to configure my machine to support a database server and allow me to work locally on my computer. However, I'm having a tough time trying to get the SQL server to work correctly on my home computer, so I just went ahead and read on. The chapter mostly talked about creating tables and SQL statements which I have lots of experience of from my 4610 class and internship.

I can't really do the examples in this chapter due to my computer not being configured correctly, also I'm running a little behind schedule because of my attempts of making local server work.

Some tools to access the MySQL database server are MySQL terminal and phpMyAdmin. MySQL is more hard coded tool as in you will used SQL statements to make the tables and data entry whereas phpMyAdmin is more of a graphical user-friendly tool that help with making the tables easier.


SQL Syntax
-Insert
-Select
-Put a semicolon(;) at the end of statement

Tuesday, February 10, 2009

Chapter 2 - connecting to MySQL

Chapter 2 deals with MySQL and how to store data on a database server. The example from chapter 1 deals with receiving emails from different users, but the emails can be a little overwhelming if many people uses the form. So in chapter 2 they discussed using a MySQL database to better organized data and easily access it.

I am currently trying to configure my computer to have a database server on it, so that I can perform the examples in the book.

Finalized Schedule (Updated again)

Chapter -- Due Date
1 -- Feb. 4, 2009
2 -- Feb. 11, 2009
3 -- Feb. 18, 2009
4 -- Feb. 25, 2009
5 -- Mar. 4, 2009
6 -- Mar. 18, 2009
7 -- Mar. 25, 2009
8 -- Apr. 1, 2009
9 -- Apr. 8, 2009

Sample Project --- Last 1-3 weeks of school

Tuesday, February 3, 2009

Chapter 1 - part 3(final)

Things Learned
-$_POST is a special variable called superglobal and it holds data
-$_POST is an array
-a period(.) is used for concatenation
-escape characters = represent characters in PHP that are difficult to type or conflict with other code
-PHP has a couple of escape characters -- \' - single quotes -- \"- double quotes -- \n - newlines
- \n has to be in double quoted statement or they won't work
-mail() is the code to send an email in PHP
-echo a PHP command for sending output to browser window

Monday, February 2, 2009

Chapter 1 - part 2

I read 2/3 of Chapter 1.

New things learned:
-PHP always need a server to be able to run
-Using a simple code you can test to see if your server provider supports PHP:

[< ?php
phpinfo();
?>]

Create a file called test.php, put it on your server and enter its URL into a web browser. If the browser displays information about PHP then your server supports PHP.
-PHP is dynamic
-PHP is always enclose by
- Each ends with a ;
- variable names must begin with $ and can only have _ in them, no spaces or any other special characters
-good naming convention = all lowercase and separate multi-word variable with underscores
-PHP is only case sensitive when its variable name but is insensitive when its commands




Example 1

Updated Schedule

Chapter -- Due Date
1 -- Feb. 4, 2009
2 -- Feb. 11, 2009
4 -- Feb. 18, 2009
5 -- Feb. 25, 2009
6 -- Mar. 4, 2009
7 -- Mar. 18, 2009
8 -- Mar. 25, 2009
9 -- Apr. 1, 2009

Sample Project --- Last 1-3 weeks of school