free download php and mysql interview Questions with answers-- Asked at different competitive exams
Free Online test your knowledge on php and mysql programming exams. Each questions immediate answer or explanation given below, just click View answer button and also have option of Hide Answer button to hide answer. In this given upto 100+ questions and shows answer or explanation under of each question.
Here all the questions and answers, most asked in different competitive exams and shows answers accordingly.
Q51. How many ways we can pass the variable through the navigation between the pages?
Answer:
At least 3 ways:
1. Put the variable into session in the first page, and get it back from session in the next page.
2. Put the variable into cookie in the first page, and get it back from the cookie in the next page.
3. Put the variable into a hidden form field, and get it back from the form in the next page.
1. Put the variable into session in the first page, and get it back from session in the next page.
2. Put the variable into cookie in the first page, and get it back from the cookie in the next page.
3. Put the variable into a hidden form field, and get it back from the form in the next page.
Q52.What is the maximum length of a table name, a database name, or a field name in MySQL?
Answer:
Database name: 64 characters
Table name: 64 characters
Column name: 64 characters
Table name: 64 characters
Column name: 64 characters
Q53. How many values can the SET function of MySQL take?
Answer:
MySQL SET function can take zero or more values, but at the maximum it can take 64 values.
Q54. What are the other commands to know the structure of a table using MySQL commands except EXPLAIN command?
Answer:
DESCRIBE table_name;
Q55.How can we find the number of rows in a table using MySQL?
Answer:
Use this for MySQL
SELECT COUNT(*) FROM table_name;
SELECT COUNT(*) FROM table_name;
Q56.What’s the difference between md5(), crc32() and sha1() crypto on PHP?
Answer:
The major difference is the length of the hash generated. CRC32 is, evidently, 32 bits,
while sha1() returns a 128 bit value, and md5() returns a 160 bit value. This is important
when avoiding collisions.
Q57. How can we find the number of rows in a result set using PHP?
Answer:
Here is how can you find the number of rows in a result set in PHP:
$result = mysql_query($any_valid_sql, $database_link); $num_rows = mysql_num_rows($result); echo “$num_rows rows found”;
Q58. How many ways we can we find the current date using MySQL?
Answer:
SELECT CURDATE(); SELECT CURRENT_DATE(); SELECT CURTIME(); SELECT CURRENT_TIME();
Q59. Give the syntax of GRANT commands?
Answer:
The generic syntax for GRANT is as following
GRANT [rights] on [database] TO [username@hostname] IDENTIFIED BY [password]
Now rights can be:
a) ALL privilages
b) Combination of CREATE, DROP, SELECT, INSERT, UPDATE and DELETE etc.
We can grant rights on all databse by usingh *.* or some specific database by database.* or a specific table by database.table_name.
GRANT [rights] on [database] TO [username@hostname] IDENTIFIED BY [password]
Now rights can be:
a) ALL privilages
b) Combination of CREATE, DROP, SELECT, INSERT, UPDATE and DELETE etc.
We can grant rights on all databse by usingh *.* or some specific database by database.* or a specific table by database.table_name.
Q60. Give the syntax of REVOKE commands?
Answer:
The generic syntax for revoke is as following
REVOKE [rights] on [database] FROM [username@hostname]
Now rights can be:
a) ALL privilages
b) Combination of CREATE, DROP, SELECT, INSERT, UPDATE and DELETE etc.
We can grant rights on all databse by usingh *.* or some specific database by database.* or a specific table by database.table_name.
REVOKE [rights] on [database] FROM [username@hostname]
Now rights can be:
a) ALL privilages
b) Combination of CREATE, DROP, SELECT, INSERT, UPDATE and DELETE etc.
We can grant rights on all databse by usingh *.* or some specific database by database.* or a specific table by database.table_name.
0 Comments:
Post a Comment