0% found this document useful (0 votes)
3 views2 pages

External Advanced Java IMP-3

The document provides a series of short and long questions related to PHP and MySQL, covering topics such as PHP errors, database creation, website types, HTTP methods, operators, looping statements, and form validation. It includes definitions, differences, and examples relevant to advanced Java and PHP programming. Key concepts such as constants, data types, and variable naming rules are also discussed.

Uploaded by

mrthor0929
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

External Advanced Java IMP-3

The document provides a series of short and long questions related to PHP and MySQL, covering topics such as PHP errors, database creation, website types, HTTP methods, operators, looping statements, and form validation. It includes definitions, differences, and examples relevant to advanced Java and PHP programming. Key concepts such as constants, data types, and variable naming rules are also discussed.

Uploaded by

mrthor0929
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

External Advanced Java IMP

Short Questions (2 Marks)

1. What is the meaning of PEAR in PHP?


PEAR stands for PHP Extension and Application Repository. It is a framework and distribution
system for reusable PHP components and libraries.

2. What are the steps to create a new database using MySQL and PHP?
1. Connect PHP with MySQL using mysqli_connect().
2. Write SQL query using CREATE DATABASE.
3. Execute query using mysqli_query().
4. Display success or error message.

3. What are the different types of PHP errors?


Parse Error, Fatal Error, Warning Error, Notice Error.

4. What is NULL in PHP?


NULL is a special data type which represents a variable with no value assigned.

5. How are constants defined in PHP?


Constants are defined using define() function.

6. What are some popular frameworks in PHP?


Laravel, CodeIgniter, Symfony, CakePHP, Zend Framework.

7. How is a PHP script executed?


A PHP script is executed on the server by the PHP interpreter.

8. What are the steps to create a new database using MySQL and PHP?
Open MySQL connection, write CREATE DATABASE query, execute query, and close connection.

Long Questions (5 Marks)

1. Differentiate between static and dynamic websites.


Static websites have fixed content while dynamic websites change content dynamically. Static
websites use HTML/CSS and dynamic websites use PHP with databases.

2. Differentiate between GET and POST methods in PHP.


GET sends data through URL and is less secure. POST sends data secretly and is more secure.

3. Define operators. Explain different types of operators in PHP.


Operators are symbols used to perform operations on variables and values. Types include
Arithmetic, Assignment, Comparison, Logical, and Increment/Decrement operators.

4. Discuss various looping statements used in PHP.


PHP provides for loop, while loop, do-while loop, and foreach loop for repeated execution of code.

5. Differentiate between require() and require_once() functions.


require() includes a file multiple times while require_once() includes it only once.

6. Discuss the data types used in PHP.


Main data types are Integer, Float, String, Boolean, Array, Object, and NULL.

7. What is form? Discuss validation for form in PHP.


A form collects user data. Validation checks whether user input is correct before processing.
8. Write a PHP program to display sum of given numbers.
Example:
<?php
$a = 10;
$b = 20;
echo $a + $b;
?>

9. How can you embed PHP code in an HTML page?


PHP code can be embedded using <?php ?> tags inside HTML pages.

10. What are the variable naming rules in PHP?


Variables start with $, cannot start with number, no spaces allowed, and are case-sensitive.

11. What is array? Write types of array and explain.


An array stores multiple values in one variable. Types are Indexed Array, Associative Array, and
Multidimensional Array.

You might also like