Hi, im new to the forum so i hope i dont do anything wrong lol.

ok lets get to the point im making an instant messenger with MySQL not flatfile or ini, the messenger consists of a server and a client. ok.

here is my function .bas

Code:
Public Function login(name As String, pass As String, user As Integer) As Integer
Dim filepass As String
Dim blist(200) As String
Dim lsti As Integer
Dim maxlsti As Integer
lsti = 0
If MySQLExists("SELECT * FROM users WHERE username = '" & name & "'") = True Then
filepass = MySQLQuery("SELECT password FROM users WHERE username = '" & name & "'")
Else
frmServer.Server(user).SendData "No user exists"
Exit Function
End If
If pass = filepass Then
'frmUsers.lstUsers.AddItem (name)
frmServer.lstUsers.AddItem name
lusers(userin) = name
userin = userin + 1
frmServer.Server(user).SendData ("Loged in" & vbCrLf)
linus(user) = name
linus(user + 1) = "end"
MySQLQuery ("UPDATE users SET list = '" & blist(lsti) & "' WHERE username = '" & name & "'")
lsti = lsti + 1
While lsti > maxlsti
frmServer.Server(user).SendData blist(maxlsti) & vbNewLine
maxlsti = maxlsti + 1
Wend
frmServer.Server(user).SendData ("Done" & vbNewLine)
End If
If pass <> filepass Then
frmServer.Server(user).SendData ("Wrong password" & vbCrLf)
End If
End Function
ok its the filepass. if you login with no password it works but if u use "the correct password" it dosent.


My question is why?

please help,

Kind Regards,
Nick