[RESOLVED] Editing a cell in MySQL database?
Hey guys, I have a question regarding table cell editing (I think)?
What I want to do, is make an account password changer. I've already got registering and login sorted and thought this would be a nice additional feature.
I want it to change the value of the cell in the 'Password' in the row of the set 'accountName'.
I've tried the below code, and it seems to change the correct cell, but it inputs a different value.
Say I replace "newPass.Text" with "12345", the cell in the table will change it's value to "*85D0F19E5598AC04AC7B3FCF"?
Code:
Dim SqlQuery = "UPDATE Users SET Password=password('" & newPass.Text & "') where Username='" & accountName & "'"
Is this my fault, have I gone wrong somewhere? Thanks.
Whole code the the Sub:
Code:
Private Sub changePassword()
MySqlConnection = New MySqlConnection
MySqlConnection.ConnectionString = serverString
MySqlConnection.Open()
Dim MyAdapter As New MySqlDataAdapter
Dim SqlQuery = "UPDATE Users SET Password=password('" & newPass.Text & "') where Username='" & accountName & "'"
Dim Command As New MySqlCommand
Command.Connection = MySqlConnection
Command.CommandText = SqlQuery
MyAdapter.SelectCommand = Command
Dim MyData As MySqlDataReader
MyData = Command.ExecuteReader
End Sub
Re: Editing a cell in MySQL database?
Fixed it, turns out the brackets around the newPass.Text didn't need to be there!
Code:
Dim SqlQuery = "UPDATE Users SET Password='" & newPass.Text & "' where Username='" & accountName & "'"