Dave,
The documentation has several examples. Here's a function we use. Are
you having a particular difficulty?
Regards,
Andy.
<snip>
MYSQL *aDb = NULL;
int xConnect()
{
#define MYSQL_HOST "192.168.103.112" // or host name
#define MYSQL_DB "foodb" // database name
#define MYSQL_USERID "myuser" // DB user name
#define MYSQL_PASSWORD "mypass" // password
aDb = mysql_init(NULL);
if (!mysql_real_connect(aDb,MYSQL_HOST,MYSQL_USERID,
MYSQL_PASSWORD,MYSQL_DB,0,NULL,0)) {
die("701 Unable to connect\r\n");
}
return -1;
}
</snip>
dave wrote:
>
> anyone have a good sample script of connecting mysql from C API? thanks
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]