Created
November 20, 2015 15:14
-
-
Save anonymous/4b9b9d84abd7db059ce9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim vorname As String = register_vorname.Text | |
Dim nachname As String = register_nachname.Text | |
Dim email As String = register_email.Text | |
Dim PW As String = register_pw1.Password | |
Dim verfuegbar As Boolean = False | |
SQL = "SELECT `vorname` FROM `benutzer`" | |
Command.Connection = MySQL | |
Command.CommandText = SQL | |
Adapter.SelectCommand = Command | |
Data = Command.ExecuteReader() | |
Do While Data.Read | |
If vorname = Data("vorname") Then | |
verfuegbar = False | |
Else | |
verfuegbar = True | |
End If | |
Loop | |
If verfuegbar = True Then | |
SQL = "INSERT INTO `benutzer` (`vorname`, `nachname`, `email`, `password`) VALUES ('" & vorname & "', '" & nachname & "', '" & email & "', '" & PW & "');" | |
MsgBox(SQL, 32) | |
Else | |
MsgBox("Der Name ist bereits vergeben!", vbExclamation) | |
End If | |
Data.Close() | |
MySQL.Close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment