=sinister= Posted October 8, 2006 Share Posted October 8, 2006 I'm creating a security system using MySQL Databases, but the following code doesn't work! $Read = GUICtrlRead($Password) $Connect = _MySQlConnect("******", "****", "*******", "*****.com", "{MySQL ODBC 3.51 Driver}") $GetPasswords = _ArrayCreate(_GetTblNames($Connect)) _MySQLEnd($Connect) If _ArraySearch($GetPasswords, $Read) <> -1 Then ExitLoop Else MsgBox(16, "Error", "Incorrect passcode!") ;Exit EndIf Any Ideas? Link to comment Share on other sites More sharing options...
jvanegmond Posted October 8, 2006 Share Posted October 8, 2006 I should start of, saying that I'm mad at you for saying the UDF is flawed, while it has been tested by hundreds of people and have found that it worked perfectly. Secondly, I also find your script example very lazy. You copied a part of your script and never even tested if this was ready to be run. I can see that it isn't. When you rewrite your script in a shorter example, you can often find the mistake that you made, and that is why we will always ask you to include a short reproduction script of what is going wrong. However, I can easily see a few things that you do wrong, and I shall point them out for you: You do no @error checking. When you try to connect, you automatically assume it has connected succesfully. You should do somewhat in the range of this: $Connect = _MySQlConnect("******", "****", "*******", "*****.com", "{MySQL ODBC 3.51 Driver}") If @error Then Exit EndIf You should also redo your research on the function parameters and it's return values. I don't know if this has changed, but when I worked with the UDF's the return value where objects of some kind. Next, always keep your code tidy this makes it easier to understand and allows you to easily spot any mistakes you have made. github.com/jvanegmond Link to comment Share on other sites More sharing options...
=sinister= Posted October 8, 2006 Author Share Posted October 8, 2006 No no, i'm not saying the UDF is flawed, i'm saying maybe my script has an error, or maybe it's just my web hosting. I used the @error check, I forgot to add one . I got an error, of course. I'm guessing theres something wrong with my host, thanks. I'll check up on it. Link to comment Share on other sites More sharing options...
jvanegmond Posted October 8, 2006 Share Posted October 8, 2006 I see. Well, come back if you have another question. I'll recheck this topic regularly. You're welcome. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now