fname $row->lname\n'; } 1.The fnames and lnames of all the customers will be printed, 2.The lnames and fnames of all the customers will be printed, 3.The fnames and lnames of all the customers will be printed in the reverse order, 4.Only the fname and lname of the first customer will be printed, 5.Only the fname and lname of the last customer will be printed">
MCQs > IT & Programming > LAMP > What will happen if the following code is executed? $resultSet = mysql_query('SELECT fname, lname FROM customers') for ($nIndex = 0; $nIndex < mysql_num_rows($resultSet) ; $nIndex++) { if (!mysql_data_seek($resultSet, $nIndex)) { echo "Cannot seek to row $nIndex\n"; continue; } if(!($row = mysql_fetch_object($resultSet))) continue; echo '$row->fname $row->lname
\n'; }

LAMP MCQs

What will happen if the following code is executed?

$resultSet = mysql_query("SELECT fname, lname FROM customers")
for ($nIndex = 0; $nIndex < mysql_num_rows($resultSet) ; $nIndex++)
{
        if (!mysql_data_seek($resultSet, $nIndex))
        {
            echo "Cannot seek to row $nIndex\n";
            continue;
        }
        if(!($row = mysql_fetch_object($resultSet)))
            continue;
        echo "$row->fname $row->lname<br />\n";
}

Answer

Correct Answer: The fnames and lnames of all the customers will be printed

Explanation:

Note: This Question is unanswered, help us to find answer for this one

LAMP Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

LAMP Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it