0% found this document useful (0 votes)
86 views6 pages

Iqtech Ltd. Exam (Basic Part) On PHP + Mysql Course: Time: 60 Mins Total Questions:30 Total Marks:60 Pass Marks:45

iQtech Ltd. provides a 60 minute exam with 30 multiple choice questions testing knowledge of PHP and MySQL. The exam covers topics like PHP comments, data types, functions, arrays, and MySQL queries. It aims to test understanding of concepts like recursive functions, data type conversion, and connecting PHP to MySQL databases.

Uploaded by

bunamoni
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views6 pages

Iqtech Ltd. Exam (Basic Part) On PHP + Mysql Course: Time: 60 Mins Total Questions:30 Total Marks:60 Pass Marks:45

iQtech Ltd. provides a 60 minute exam with 30 multiple choice questions testing knowledge of PHP and MySQL. The exam covers topics like PHP comments, data types, functions, arrays, and MySQL queries. It aims to test understanding of concepts like recursive functions, data type conversion, and connecting PHP to MySQL databases.

Uploaded by

bunamoni
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 6

iQtech Ltd.

Exam (Basic part) on PHP + MySQL course


Time: 60 mins Total Questions:30
Total marks:60 Pass marks:45

Name:________________________________________________________________

Batch:_____________________________________Mobile:____________________

Questions starts here=============================================

1. Which of the following is not a valid way to start a PHP comment?

a) //

b) ##

c) /*

d) None of the above

Ans:

2. Using switch/case rather than multiple if statements is

a) Faster

b) Easier to read

c) Both a) and b)

d) None of the above

Ans:

3. What will $foo be set to in this expression: $foo = "eprint" * 2?

A. 0

B. 1

C. 2

D. NULL

Ans:
4. What will $bar be set to in this expression: $bar = 5 * 5 + 5?

A. 30

B. 50

C. 5

D. NULL

Ans:

5. To delete a variable, what function do you use:

a) delete()

b) unset()

c) deset()

d) remove()

Ans:

6. To uppercase the first letter in a string, what function do you use:

a) str_to_upper()

b) str_to_upper_first()

c) uc_first()

d) ucfirst()

Ans:

7. Which of the following statements are true about recursive functions:

a) They call themselves

b) They need to be inside loops

c) They need to be registered with PHP

d) They must return a value

Ans:

8. What will be the value of $b after running the following code?

<?php
$a = array('c', 'b', 'a');
$b = (array) $a;

print_r($b);
?>

A.TRUE
B. array('c', 'b', 'a')
C. array(array('c', 'b', 'a'))
D. None of the above
E. Array ( [0] => c [1] => b [2] => a )

Ans:

09. Which of the following data types are incorrect in MySQL?

a) CHAR(20)

b) VARCHAR(300)

c) TEXT

d) LONGINT

e) None of the above

Ans:

10. Suggest the ideal data type for the following fields:

a) First name

b) Age

c) Height

Ans:

11. Who is the father of PHP

Ans:

12. What is the difference between $message and $$message?

Ans:

13. How can we create a database using PHP and MySQL?

Ans:
14. What are the current versions of apache, PHP, and MySQL?

Ans:

15. How can we know the count/number of elements of an array?

Ans:

16. What are the advantages of MySQL and PHP?

Ans:

17. What is the difference between char and varchar data types in MySQL?

Ans:

18. What is the full form of PHP?

Ans:

19. What is the full form of LAMP?

Ans:

20. Which platforms, servers, and databases are supported by PHP?

Ans:

21. What will be the output of this code?


<?php
$x=08;
echo $x;
?>
A. 08
B. 0
C. 8
D. NULL

Ans:

22. What will be the output of this code?

<?php
$txt1="5,6,7,8,9";
$txt2="0,1,2,3,4,";
echo $txt2 . " " . $txt1;
?>

Ans:
23. What will the following script output?
<?php
function father()
{
function child()
{
echo "I don't exist until father() is called.\n";
}
echo "Father";
}
father();
?>

Ans:

24. What is the name of a function used to convert an array into a string?

Ans:

25. What will the following script output?


<?php
$array = array (0.1 => 'a', 0.2 => 'b');
echo count ($array);
?>
A. 1
B. 2
C. 0
D. Nothing
E. 0.3

Ans:

26. What will the following script output?


<?php
echo 'Testing ' . 1 + 2 . '45';
?>
A. Testing 1245
B. Testing 345
C. Testing 1+245
D. 245
E. Nothing

Ans:
Name Owner Species Sex Birth Death
Fluffy Harold Cat f 1993-02-04
Claws Gwen Cat m 1994-03-17
Buffy Harold Dog f 1989-05-13
Fang Benny Dog m 1990-08-27
Bowser Diane Dog m 1979-08-31 1995-07-29
Chirpy Gwen Bird f 1998-09-11
Whistler Gwen Bird 1997-12-09
Slim Benny Snake m 1996-04-29

FIGURE 1: Table name “pet”

27. What is the MySQL query for finding the initials (1st character) word “b” from
“name” column ? (FIGURE 1 is just for helping your imagination)

A. SELECT * FROM pet WHERE name LIKE "b%";

B. SELECT * FROM pet WHERE name LIKE "%w%";

C. SELECT * FROM pet WHERE name LIKE "_____";

ANS:

28. What is the MySQL query for finding the word “w” from anywhere of the words
from “name” column ? (FIGURE 1 is just for helping your imagination)

A. SELECT * FROM pet WHERE name LIKE "b%";

B. SELECT * FROM pet WHERE name LIKE "%w%";

C. SELECT * FROM pet WHERE name LIKE "_____";

ANS:

29. What is the MySQL query for finding the words formed 5 spacing from “name”
column ? (FIGURE 1 is just for helping your imagination)

A. SELECT * FROM pet WHERE name LIKE "b%";

B. SELECT * FROM pet WHERE name LIKE "%w%";

C. SELECT * FROM pet WHERE name LIKE "_____";

Ans:

30. How to connect MySQL database to PHP ? ( give 1 line code)

Ans:

You might also like