Set - 5

Question 1 :

What are the other commands to know the structure of a table using MySQL commands except EXPLAIN command? 

Answer :

DESCRIBE table_name;


Question 2 :

How can we find the number of rows in a table using MySQL?

Answer :

Use this for MySQL
SELECT COUNT(*) FROM table_name;


Question 3 :

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.


Question 4 :

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";

 


Question 5 :

How many ways we can we find the current date using MySQL?

Answer :

SELECT CURDATE();
SELECT CURRENT_DATE();
SELECT CURTIME();
SELECT CURRENT_TIME();