"MySQL" Please respond to the following:

Computer Science
Tutor: None Selected Time limit: 1 Day

Contrast the return value of the mysql_error() function and the mysql_errno() function. Provide an example of a scenario or situation of when each function would be used.

Feb 28th, 2015

MYSQL_ERROR

mysql_error is used in order to return "Error" message from the previous mysql operation

example

$servername = "localhost"

$username = "root"

$password = ""

// Create connection

$connection = mysql_connect( $servername , $username , $password ) or die ( mysql_error );

//============================================================================


MYSQL_ERRNO

mysql_errno return numerical value of "Error" Message from the previous mysql operation

example

// Create Connection

$connection = mysql_connect( $servername , $username , $password );


if ( mysql_errno($connection) )

echo " Success conected";

else

echo " Fail to connect ;


Mar 1st, 2015

Did you know? You can earn $20 for every friend you invite to Studypool!
Click here to
Refer a Friend
...
Feb 28th, 2015
...
Feb 28th, 2015
Mar 30th, 2017
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer