Sunday, 29 May 2016

Week 13 Lab class

Today is our last class and we had a online quiz. My result is not good because not enough time to do.




Week 12 Lab class

Today our lab class replaced with the program sport day SMMTC WEEK.





9/5/2016 Lab Class

Today our lab session is using phpMyAdmin create a application. Lecturer had uploaded a zip file and we were required to connect it to the database. 


We need to create a new user account.





Tick "Grant all privileges on wildcard name"






Next step is to select the database and create the database then will go to create table by inserting the numbers of column.





This is the result of INSERT INTO data to table.




After insert the data, I tried to open the form using localhost.





































Class 2/5/2016 (Week 10)


Today class is about MySQL. We learnt about the Server Side Script which is MySQL. SQL is a standard language for accessing databases. We have learned about Database, DBMS, and also relational Databases.


What is SQL (Structured Query Language)
  • SQL stands for Structured Query Language
  • SQL allows you to access a database
  • SQL is an ANSI standard computer language
  • SQL can execute queries against a database
  • SQL can retrieve data from a database
  • SQL can insert new records in a database
  • SQL can delete records from a database
  • SQL can update records in a database
  • SQL is easy to learn

Data Manipulation Language (DML)
These query and update commands together form the Data Manipulation Language (DML), 
part of SQL:

  • SELECT - extracts data from a database
  • UPDATE - updates data in a database
  • DELETE - deletes data from a database
  • INSERT INTO - inserts new data into a database


Data Definition Language  

The most important DDL statements in SQL are:
  • CREATE TABLE - creates a new table
  • ALTER TABLE - modifies a table
  • DROP TABLE - deletes a table
  • CREATE INDEX - creates an index (search key)
  • DROP INDEX - deletes an index 


Accessing MySQL via PHP
There are four steps process to access MySQL from a PHP script: 

Step 1: Make a connection to MySQL database server .
  • require that you specify the location of the database, plus a username and password.

Step 2: Select the database within MySQL that you want to work with .
  • Example: select "SIS" database.

Step 3: Issue an SQL statement/create the query.
  •  could be any valid SQL keyword, example: SELECT, UPDATE.

Step 4: Iterate through the SQL result set: if you are issuing a SELECT statement, iterate through the result set and extract each record.
  •  Example: extract specific fields in each record and display as HTML.