📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!


    Question

    Which of the following statement is INCORRECT related to

    mysql_list_tables() function ?
    A We can display a list of tables present in a database by using mysql_list_tables() function Correct Answer Incorrect Answer
    B Connection has to be established before call of mysql_list_tables() function Correct Answer Incorrect Answer
    C Connection need not to be established before call of mysql_list_tables() function Correct Answer Incorrect Answer
    D The result pointer returned by this function is used by mysql_tablename() function to display the name of the tables. Correct Answer Incorrect Answer

    Solution

    Why this is correct: mysql_list_tables() (from the old PHP mysql_* extension) requires an active DB connection (link identifier) to query the server for table list. So saying a connection is not needed is incorrect. Why the others are correct: 1.      The function is intended to list tables in a database. 2.      You must establish a connection first (true). 3.      The result resource can be used with mysql_tablename() to extract table names (true). Note: the mysql_* PHP extension is deprecated and removed in newer PHP versions in favor of mysqli /PDO, but the behavior above is the historical behavior relevant to the question.

    Practice Next

    Relevant for Exams:

    ask-question