mysql-connector-c

Problem with handling the result of SELECT query in MYSQL C API

依然范特西╮ 提交于 2019-12-13 03:23:58
问题 I'm getting a Internal Server Error with one of my scripts. I'm using MYSQL C API. https://dev.mysql.com/doc/refman/5.6/en/c-api.html Here is the corresponding part of my script: MYSQL *con; MYSQL_RES *result; MYSQL_ROW robe; con = mysql_init(NULL); if (!mysql_real_connect(valid values)) { printf("Content-type: text/html\n\n"); printf("Could not connect\n"); exit(0); } char somequery[512]; //userinput is sanitized beforehand int sog = sprintf(somequery, "SELECT password from testtab WHERE