i have to write a c program which connects with the mysql database.

i have installed visual studio c++ express 2010 and the mysql installer for windows.

i have widows xp os.

can anyone tell me the step by step process to connect to the mysql database.
and give me a c program example as well.

please help!

Here are some very good examples of how to link C client programs to MySql and create and populate databases, as well as fetch data:

Really good book:

http://www.kitebird.com/mysql-book/ch06-3ed.pdf

Really good site examples:

http://zetcode.com/tutorials/mysqlcapitutorial/
http://www.cyberciti.biz/tips/linux-unix-connect-mysql-c-api-program.html

The main methods used are:

mysql_config

mysql_real_connect
mysql_query
mysql_use_result
mysql_fetch_row

I hope that helps, the information provided is really clear and easily to understand so take a look :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.