Bit3202 Internet Programming Regular Reg Supp
Bit3202 Internet Programming Regular Reg Supp
BBIT/BIT
REGULAR
d) Explain five reasons why MySQL is popularly used with web applications as the
database server. (5 Marks)
ID Surname Address
112 Mwere Nairobi
231 Owino Thika
313 Torich Mombasa
i. Write the web form code that can be used to capture the above records. Draw
the graphical view of the form. (4 Marks)
ii. Write the PHP code that can be used receive the data from the form and
insert into the table. (6 Marks)
iii. Write PHP based code for deleting Torich record from the table. (4 Marks)
c) Using PHP based sample code, show how mysql UPDATE statement is
implemented. (5 Marks)
$fname=”John”;
$county=”Nairobi”;
Write an output statement that prints out given below. (3 Marks)
(i) Using switch case write a program that that assigns Course names given
the course code. E.g if the course code is BA then it prints - Bachelor of
Arts. (6 Marks)
c) Explain the use of the following functions and show how they are used.
(6 Marks)
i. mysqli_select_db ( )
ii. mysqli_fetch_array()
a) PHP has the capability to process and send email to mail server using mail( )
function.
i. Explain the various mail( ) function arguments. (4 Marks)
ii. Using example code, demonstrate how mail() function works. (6 Marks)
ii. Using sample program code, explain two major types of variable scopes
supported by PHP. (6 Marks)
a) Write a PHP function program that accepts three arguments of type integer then
compute the product of the arguments. The program returns the results to the
calling point of the program. (6 Marks)
b) Write sample PHP code to check if the user name and password entered by the
user on login form is correct. The user log in details are stored in MySQL table
name tbl_users (6 Marks)
d) Using sample code, demonstrate how to declare and initialize array in PHP.
(4 Marks)