"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

Are you studying on the go? Check out our FREE app and post questions on the fly!
Download on the
App Store
...
Feb 28th, 2015
...
Feb 28th, 2015
Dec 5th, 2016
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