0

connect to MySQL: works fine.

mysql_real_connect(conn, server, user, pass, db, 0, NULL, 0);

I want to do something like

char *status = "";
status = mysql_real_connect(conn, server, user, pass, db, 0, NULL, 0);
printf(stauts);

the above attempt results in compile error:

warning: assignment from incompatible pointer type

Solution is needed.

1
  • 1
    Well, basically, read a manual or tutorial about using mysql library in C. At first mysql_real_connect one. Commented Jun 10, 2017 at 1:36

1 Answer 1

1

From the MySQL manual mysql_real_connect returns a MYSQL* connection handler and thus cannot be stored in a char*.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.