LOYOLA COLLEGE (AUTONOMOUS), CHENNAI – 600 034 B.C.A. DEGREE EXAMINATION – COMPUTER APPLICATIONS SIXTH SEMESTER – April 2009 CA 6609/CS 6609 - WEB PROGRAMMING WITH PHP AND MYSQL Date & Time: 18/04/2009 / 9:00 - 12:00 Dept. No. SH 15 Max. : 100 Marks Part A Answer ALL the Questions (10 * 2 = 20) 1. Write down the output statement in php. 2. Give the difference between Break and Continue. 3. Define Cookies. 4. Write any four file related functions in php. 5. Define Database. Give any four benefits of its approach. 6. Define Primary Key & Foreign Key. 7. Give the basic MySQL data type. 8. Give an example to limit query results. 9. Write down the syntax for throwing error message in php. 10. Write a query to insert username, password after encryption, registration date as today’s date to table users. Part B Answer ALL the Questions (5 * 8 = 40) 11. (a) Explain the two types of For statements with an example. (or) (b) Write a small PHP script to generate ten random numbers each greater than the previous number. 12. (a) Explain the two functions used in PHP for conversion between strings and arrays. (or) (b) Write a PHP code using functions which takes a text and returns it with bold tags. 13. (a) Give the three levels of Database architecture. (or) (b) Define 1NF,2NF, 3NF and BCNF 14. (a) Write short notes on data manipulation functions of on numeric, text and date in MySql. (or) (b) Explain with examples of Creating and populating a Database. Also explain grouping of Data. 15. (a) Explain the functions used to connect to mySQL and selecting the database. (or) (b)What are the common errors that are encountered in mySQL? How errors are handled? Part C Answer Any TWO Questions (2 * 20 = 40) 16. (a) What are the syntactical rules that has to be followed while creating a PHP variable. Also write short notes about the operators in PHP. (b) Define Arrays. Briefly explain about creating and processing of arrays with examples. 17. (a) Explain the Major DBMS Functions & Components in Detail. (b) 14. Solve the following queries. Employee(id, name, designation, dept_no, salary) (i) List all employees whose name start with ‘AL’ and ends with ‘N’ with a single character in between. (ii) Find all salesperson in dept 30 whose salary is greater than or equal to 15000. (iii) Find all employees whose salary is within the range 12000 to 20000. (iv) List all employees who are analyst, clerks and managers. (v) Select all the rows of salary in ascending order. 18. (a) Explain the following with an example (i) mysql_query() (ii) mysql_fetch_array() (iii) mysql_fetch_row() (iv) mysql_num_rows() (v)mysql_affected_rows() (b) Write short notes on setting, accessing and deleting session variables.