Today is our last class and we had a online quiz. My result is not good because not enough time to do.
About STIV3013 WWW Programming
Sunday, 29 May 2016
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.
This is the result of INSERT INTO data to table.
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.
Saturday, 23 April 2016
21/4/2016
Today lab class is to do past year Final Exam Question STIV3013 sem 1 2015-2016 ^_^
Answer of Question: -
1. //retrieve information from the Form
$name = $_POST (“name”);
$matric = $_POST (“matric”);
$stiv1023_mark = $_POST (“stiv1023_mark”);
$stiv2023_mark = $_POST (“stiv2023_mark”)
$stiv3013_mark = $_POST (“stiv3013_mark”);
$vkhb2031_mark = $_POST (“vkhb2031_mark”);
2. //calculate grade for each course by calling calculateGred() function
$stiv1023_grade = calculateGred($stiv1023_mark);
$stiv2023_grade = calculateGred($stiv2023_mark);
$stiv3013_grade = calculateGred($stiv3013_mark);
$vkhb2031_grade = calculateGred($vkhb2031_mark);
3. //calculate point for each course by calling calculatePoint() function
$stiv1023_point = calculatePoint($stiv1023_grade);
$stiv2023_point = calculatePoint($stiv2023_grade);
$stiv3013_point = calculatePoint($stiv3013_grade);
$vkhb2031_point = calculatePoint($vkhb2031_grade);
4. //calculate TotalPoint based on point for each course and credit
$TotalPoint=($stiv1023_point*3)+($stiv2023_point*3)+($stiv3013_point*3)+
($vkhb2031_point*1);
5. //calculate GPA based on Total Point and total credit
$GPA = TotalPoint/10;
6. //calculate final result by calling calculateResult() function
$Final_Result = calculateResult($GPA);
7. //function to calculate the grade based on mark
calculateGred($mark)
{
if ($mark >= 90)
$grade = ‘A’;
else if ($mark>=80)
$grade = ‘B’;
else if ($mark>=70)
$grade = ‘C’;
else if ($mark>=60)
$grade = ‘D’;
else if ($mark>=50)
$grade = ‘E’;
else
$grade = ‘F’;
return $grade
}
8. //function to calculate the point based on grade
calculatepoint($grade)
{
if ($grade== ‘A’)
$point= 4.0;
else if ($grade== ‘B’)
$point=3.5;
else if ($grade==’C’)
$point=3.0;
else if ($grade= ‘D’)
$point= 2.5;
else if ($grade= ‘E’)
$point= 2.0;
else
$point= 1.0;
return $point
}
9. //function to calculate the result based on GPA
calculateResult($GPA)
{
If ($GPA >= 3.00)
$GPA = “Pass with distinction”;
else if ($GPA >= 2.00)
$GPA = “Pass”
else
$result= “Fail”;
Return result;
}
4/4/2016
Today our class Lecturer ask us to mark the Lab Tutorial Exercise that has given in last week. Lecturer also teach our calculate BMI by using PHP.
The below is the BMI formula:
The below is the BMI formula:
31/3/2016
In the lab class 31/3/2016, a test about PHP was given by our lecturer, Dr.Syamsul.
Here are the output for this week lab:
Question 1
Question 2
Question 2(b)
Question 3
Question 4
Subscribe to:
Comments (Atom)



















