Skip to content

Instantly share code, notes, and snippets.

Created November 20, 2015 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4b9b9d84abd7db059ce9 to your computer and use it in GitHub Desktop.
Save anonymous/4b9b9d84abd7db059ce9 to your computer and use it in GitHub Desktop.
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