Tuesday, February 24, 2009
Javascipt objective and multiple choice interview question
• 1. client.navName
• 2. navigator.appName
• 3. browser.name
42. How do you put a message in the browser's status bar?
• 1. window.status("put your message here")
• 2. window.status = "put your message here"
• 3. status("put your message here")
• 4. statusbar = "put your message here"
43. How do you find the largest number of 2 and 4 in jaascript?
• 1. ceil(2,4)
• 2. Math.ceil(2,4)
• 3. Math.max(2,4)
• 4. top(2,4)
44. How do you round the number 7.25, to the nearest whole number in javascript?
• 1. round(7.25)
• 2. Math.round(7.25)
• 3. Math.rnd(7.25)
• 4. rnd(7.25)
45. What is the correct way to write a JavaScript array?
• 1. var txt = new Array("tim","kim","jim")
• 2. var txt = new Array:1=("tim")2=("kim")3=("jim")
• 1. var txt = new Array="tim","kim","jim"
• 2. var txt = new Array(1:"tim",2:"kim",3:"jim")
46. How many different kind of loops are there in JavaScript?
• 1. Two. The "for" loop and the "while" loop
• 2. One. The "for" loop
• 1. Four. The "for" loop, the "while" loop, the "do...while" loop, and the "loop...until" loop
47. How do you call a function named "myFunction" in javascript?
• 1. myFunction()
• 2. call myFunction()
• 1. call function myFunction
48. How do you write "Hello World" in an alert box?
• 1. alert("Hello World")
• 2. alertBox="Hello World"
• 1. msgBox("Hello World")
• 2. alertBox("Hello World")
49.
50. What is the correct JavaScript syntax to write "Hello World"?
• 1. ("Hello World")
• 2. response.write("Hello World")
• 1. document.write("Hello World")
• 2. "Hello World"
Answer:
Q Ans Q Ans
46 1
47 1
48 1
49 2
50 3
36 2
37 3
38 1
39 2
40 3
41 2
42 2
43 3
44 2
45 1
Mysql objective and multiple choice interview question
• 1. GET
• 2. EXTRACT
• 3. SELECT
• 4. QUERY
27. Which SQL statement is used to delete data from a database?
• 1. TRUNCATE
• 2. DELETE
• 3. REMOVE
28. Which SQL statement is used to insert new data in a database?
• 1. ADD RECORD
• 2. ADD INTO
• 3. INSERT
• 4. ADD NEW
29. With SQL, how do you select all the columns from a table named "Persons"?
• 1. SELECT [all] FROM Persons
• 2. SELECT All Persons
• 3. SELECT *.Persons
• 4. SELECT * FROM Persons
30. The OR operator displays a record if ANY conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true
• 1. True
• 2. False
31. With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"?
• 1. SELECT * FROM Persons WHERE FirstName LIKE 'Peter' AND LastName LIKE 'Jackson'
• 2. SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'
• 3. SELECT FirstName='Peter', LastName='Jackson' FROM Persons
32. Which SQL statement is used to return only different values?
• 1. SELECT UNIQUE
• 2. SELECT INDENTITY
• 3. SELECT DIFFERENT
• 4. SELECT DISTINCT
33. Which SQL keyword is used to sort the result-set?
• 1. SORT BY
• 2. ORDER
• 3. ORDER BY
• 4. SORT
34. With SQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"?
• 1. SELECT * FROM Persons SORT BY 'FirstName' DESC
• 2. SELECT * FROM Persons ORDER BY FirstName DESC
• 3. SELECT * FROM Persons ORDER FirstName DESC
• 4. SELECT * FROM Persons SORT 'FirstName' DESC
35. How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons table?
• 1. UPDATE Persons SET LastName='Hansen' INTO LastName='Nilsen'
• 2. UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'
• 3. MODIFY Persons SET LastName='Hansen' INTO LastName='Nilsen
• 4. MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'
36. With SQL, how can you return the number of records in the "Persons" table?
• 1. SELECT COLUMNS() FROM Persons
• 2. SELECT COUNT(*) FROM Persons
• 3. SELECT COLUMNS(*) FROM Persons
• 4. SELECT COUNT() FROM Persons
37. Given an employees table as follows: empid name managerid a1 bob NULL b1 jim a1 B2 tom a1 What value will select count(*) from employees return?
• 1. 1
• 2. 2
• 3. 3
• 4. none of the above
38. The result of a SELECT statement can contain duplicate rows.
• 1. True
• 2. False
39. Sometimes the expression "select count(*)" will return fewer rows than the expression "select count(value)".
• 1. True
• 2. False
40. What type of lock will deny users any access to a table?
• 1. EXPLICIT
• 2. IMPLICIT
• 3. EXCLUSIVE
• 4. SHARED
Answer:
25 4
26 3
27 2
28 3
29 4
30 1
31 2
32 4
33 3
34 2
35 2
36 2
37 3
38 1
39 2
40 3
41 2
42 2
43 3
44 2
45 1
php objective and multiple choice interview question
• 1.
• 2.
• 3. <% %>
• 4.
2. You can define a constant by using the define() function. Once a constant is defined
• 1. It can never be changed or undefined
• 2. It can never be changed but can be undefined
• 3. It can be changed but can not be undefined.
• 4. It can be changed and can be undefined
3. The following piece of script will output:
$email=’ admin@psexam.com ’;
$new=strstr($email, ‘@’);
print $new;
?>
• 1. admin
• 2. admin@psexam
• 3. @psexam.com.
• 4. psexam.com
4. Which of the following function returns the number of characters in a string variable?
• 1. count($variable)
• 2. len($variable)
• 3. strcount($variable)
• 4. strlen($variable)
5. A variable $word is set to “HELLO WORLD”, which of the following script returns in title case?
• 1. echo ucwords($word)
• 2. echo ucwords(strtolower($word)
• 3. echo ucfirst($word)
• 4. echo ucfirst(strtolower($word)
6. Which of the following method is suitable when you need to send larger form submissions?
• 1. Get
• 2. Post
• 3. Both Get and Post
• 4. There is no direct way for larger form. You need to store them in a file and retrieve
7. The function setcookie( ) is used to
• 1. Enable or disable cookie support
• 2. Declare cookie variables
• 3. Store data in cookie variable
• 4. All of above
8. In mail($param2, $param2, $param3, $param4), the $param2 contains:
• 1. The message
• 2. The recipient
• 3. The header
• 4. The subject
9. Study following steps and determine the correct order
(1) Open a connection to MySql server
(2) Execute the SQL query
(3) Fetch the data from query
(4) Select database
(5) Close Connection
• 1. 1, 4, 2, 3, 5
• 2. 4, 1, 2, 3, 5
• 3. 1, 5, 4, 2, 1
• 4. 4, 1, 3, 2, 5
10. Which of the following is not a session function?
• 1. session_decode
• 2. session_destroy.
• 3. session_id
• 4. session_pw
11. If a boolean variable $ alive= 5;
• 1. $ alive is false
• 2. $ alive is true
• 3. $ alive is overflow
• 4. the statement is not valid
12. To produce the output I love the summer time, Which of the ofllowing statement should be used?
• 1. I love the summer time");?>
• 2. I love the $ season"; ?>
• 3. I love the summer time ; echo $ message; ?>
• 4. All of above
13. Which of the following statement produce different output
• 1.
• 2.
• 3.
• 4.
14. Which of folowiing variable assignment is 'by value' assignment in PHP
• 1. $value1= $value?
• 3. $value1= & $value?
• 4. $value1= & $value?
• 5. None
15. Identify the variable scope that is not supported by PHP
• 1. Local variables.
• 2. Function parameters
• 3. Hidden variables
• 4. Global variables
16. The output of ofllowing script would be
function addit () {
GLOBAL $somerar;
$somerar++ ;
$somerar- - ;
$somerar++ ;
echo "somerar is $somerar";
}
addit ();
• 1. somerar is 15
• 2. somerar is 16.
• 3. somerar is 1
• 4. somerar is $ somerar.
17. The left association operator % is used in PHP for
• 1. percentage
• 2. bitwise or
• 3. division
• 4. modulus
18. Which of following are compound data type?
• 1. Array
• 2. Objects
• 3. Both
• 4. None
19. The left associative dot operator (.) is used in PHP for
• 1. multiplication
• 2. concatenation
• 3. separate object and its member
• 4. delimeter
20. Which of the following functions require the allow-url-fopen must be enabled?
• 1. include()
• 2. require()
• 3. both of above
• 4. None of above
21. Which of the folowing are valid float values?
• 1. 4.5678
• 2. 4.0
• 3. 7e4
• 4. All of above
22. Which of following function return 1 when output is successful?
• 1. echo ( )
• 2. print ( )
• 3. both
• 4. None
23. Which of the following variables is not a predefined variable?
• 1. $get
• 2. $ask
• 3. $request
• 4. $post
24. The difference between include() and require()
• 1. are different how they handle failure
• 2. both are same in every aspects
• 3. is include() produced a Fatal Error while require results in a Warning
• 4. none of above
25. The most portable version of PHP tag that is compatible to embed in XML or XHTML too is:
• 1.
• 2.
• 3. <% %>
• 4.
Answer:
Q Ans Q Ans
1 4 16 2
2 1 17 4
3 3 18 3
4 4 19 2
5 2 20 3
6 2 21 4
7 3 22 2
8 4 23 2
9 1 24 1
10 4 25 4
11 2
12 4
13 3
14 1
15 3
Saturday, July 5, 2008
Have you Differences between PHP4 and PHP5 or Migrating from PHP 4 to PHP 5
the object model has been greatly improved in PHP5 (__construct and __destruct methods, improvements in member variable protection, polymorphism, interfaces- SQLite, a new embedded DB;
- New MySQLi interface;
- SimpleXML, a simplified interface for reading XML files (not suitable for writing them)
PHP 5 and the integrated Zend Engine 2 have greatly improved PHP's performance and capabilities, but great care has been taken to break as little existing code as possible. So migrating your code from PHP 4 to 5 should be very easy. Most existing PHP 4 code should be ready to run without changes, but you should still know about the few differences and take care to test your code before switching versions in production environments.
do you create subdomains using PHP?
* Edit httpd.conf - add a new virtual host section
* Restart httpd
and also we can use another ways for this.
You can crate a virtual domain by using .htaccess file and you need to set some little things in control panel.
by using .htaccess file you can crate like as a under mention example.
http://www.domain.com/?a=user --> http://user.domain.com/
can we submit a form without a submit button in php?
1.On onclick event by javascript. you can call a javascript function in which you can submit a form.for this we have use the srcipt document.forms[0].submit();
2.On body load i.e.when full dody of the page is loadedthen onLoad function in body tag you can call a javascript function which will submit the form as in the first case.
3.You can use XmlHTTPRequest object (AJAX) to submit a form. for this AJAX srcipt the page will not refresh and form will submited.