Sign in to follow this  
Followers 0
=sinister=

MySql Udf's Not Working

4 posts in this topic

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?

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

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 :lmao:. I got an error, of course. I'm guessing theres something wrong with my host, thanks. I'll check up on it.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0