May 2005
Intermediate to advanced
352 pages
14h 39m
English
mysql_error( )
char *mysql_error(MYSQL *mysql)
This returns the error message for the last function executed that failed. After a successfully executed function, an empty string is returned from this function.
...
if(!mysql_real_connect(mysql,host,"goofy",
password,database,0,NULL,0))
{
printf("Error Message: %s \n", mysql_error(mysql));
exit(EXIT FAILURE);
}
...In this example, the program is attempting to connect to the MySQL server with a user who is not in the mysql database.
Read now
Unlock full access