I have a question, for example I input something on edit and in that time when I'll click on search button it will show find message, but it shows mysql error :'( why? what I am doing wrong in this code? :(
HWND edit;
char t[MAX_PATH];
char query[MAX_PATH];
GetWindowText(edit,t,MAX_PATH);
mysql_query(conn, "CREATE TABLE writers(name VARCHAR(25))");
sprintf(query, "SELECT * FROM writers WHERE name = '%s'", t);
result1 = mysql_query(conn, "SELECT * FROM writers WHERE name = t");
mysql_query(conn, query);
if(result1 == 0)
{
result = mysql_store_result(conn);
if (mysql_num_rows(result) == 0)
{
MessageBox(0,"not find",0,0);
}
else
{
MessageBox(0,"find",0,0);
}
}
else
{
MessageBox(0,"mysql error",0,0);
}
for more info now see this image
http://d221127.u-telcom.net/lashatt/mysqleditsearcherror.JPG