I have this in my login button but it seems to have bugs here. When valid username n password is entered it login to the other dialog which is correct and working. but when a invalid user is key in it will show message that invalid login but after that i try to enter a valid user it will keep prompt me invalid login although i entered the correct one. i looks like my login form only work once. need help to solve this error im not sure where i go wrong. im quite new to C++ MFC dialog still. Thank you for you helps
when a invalid user is key in it will show message that invalid login but after that i try to enter a valid user it will keep prompt me invalid login although i entered the correct one
That's because you told it to (with count).
1 2 3 4 5 6 7 8 9 10 11
if(count==1){
this->ShowWindow(SW_HIDE);
this->ShowWindow(SW_SHOW);
CPplCMain m_pplc;
m_pplc.DoModal();
}
elseif(count>1){
MessageBox("Duplicate Username and Password.... Access denied");
}
else
MessageBox("Username and Password is in-correct");
@coder777 How do i fix this error ? i am totally C++ MFC dumb here lol don know how to use mysql_num_rows etc. do you have exact resource code on this please. i have never done this before need some examples to learn from. i understand from codes better than descriptions lol.
i tried to change to mysql_num_rows it seems working but when i type in valid user visual studio bring me back to coding prompt to while(row = mysql_fetch_row(res)) some violation error.
@kbw i use the count to determine duplicate users and i transfer the concept from C# or somewhere i rmb. if it is incorrect then how to i change it to ? any examples or you have some codes for me thanks
OK done thanks guys i found that the error lies with the mysql_close -.- i randomly remove it and it works with those codes. also i change to mysql_num_rows thanks so much