Jawaharlal Nehru Technological University Hyderabad

Jawaharlal Nehru Technological University Hyderabad B.Tech IV Year PHP PROGRAMMING Previous Question Paper (September - 2022 - R16)

B.Tech | IV Year | II Semester | R16 | September - 2022

Answer PaperPaper Code: 138GQMaximum Marks: 75Time: 3 Hours

Answer any five questions. All questions carry equal marks.

Main

115 marks
a

Explain the detailed steps in testing and configuring PHP5 to use MySQL along with installation process.

10 marks

Answer

To configure PHP to work with MySQL, follow these installation and configuration steps:

  1. Install a web server (e.g., Apache), PHP, and MySQL. Using an integrated stack like XAMPP or WAMP is the most efficient method for development.
  2. Locate the php.ini configuration file, typically found in the PHP installation directory.
  3. Open php.ini in a text editor and search for the extension section. Uncomment the line
    extension=php_mysqli.dll
    by removing the semicolon at the start.
  4. Ensure the extension_dir directive points to the correct folder containing the extension files.
  5. Restart the web server to apply the changes.
  6. Verify the installation by creating a PHP file containing the phpinfo() function. Access this file via a browser and search for the 'mysqli' section to confirm it is enabled.
  7. Test the connection using a script:
    $conn = new mysqli('localhost', 'username', 'password', 'database'); if ($conn->connect_error) { die('Connection failed'); }
b

How to set-up users and allow privileges to access MySQL data?

5 marks

Answer

To set up users and manage privileges in MySQL, use the following SQL commands:

  1. Create a new user:
    CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
  2. Grant specific privileges to the user for a database:
    GRANT SELECT, INSERT, UPDATE ON database_name.* TO 'username'@'localhost';
  3. Apply the changes immediately by running the flush command:
    FLUSH PRIVILEGES;
  4. To grant all privileges, use the ALL PRIVILEGES keyword, and to restrict access to a specific host, replace 'localhost' with the appropriate IP address or '%' for remote access.
215 marks
a

State most common uses, rules and function of PHP.

5 marks

Answer

Sign in to view the complete answer paper.

b

Demonstrate passing the variables from page to page with cookies and with forms.

10 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

What are parametrized functions and non-parameterized functions? Illustrate them with a sample PHP script.

7 marks

Answer

Sign in to view the complete answer paper.

b

List and explain various functions to work with files through your PHP script.

8 marks

Answer

Sign in to view the complete answer paper.

4

List and explain various array functions and math functions available in PHP with syntax and example.

15 marks

Answer

Sign in to view the complete answer paper.

5

How to process forms by the PHP script using $_GET and $_POST array elements? Demonstrate with an example program in PHP.

15 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Differentiate between the following statements in PHP: i) include vs require ii) include_once and require_once

6 marks

Answer

Sign in to view the complete answer paper.

b

How to include other files into your PHP documents? Illustrate the need and usage of include statement in PHP.

9 marks

Answer

Sign in to view the complete answer paper.

7

Does GD library supports merging images and add watermarks into it? Explain these operations in detail with brief illustration.

15 marks

Answer

Sign in to view the complete answer paper.

8

Summarize the three categories of MySQL data types with descriptions.

15 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the question paper of PHP PROGRAMMING from Jawaharlal Nehru Technological University Hyderabad for B.Tech ECE IV Year II Semester, September - 2022, R16.

For the solved question paper with answers, switch to the Answer Paper tab.

Other papers in PHP PROGRAMMING

Loading Question Papers

Fetching data from database...