更改資料庫連接,testdb->care(RegisterPage)
This commit is contained in:
@@ -115,13 +115,13 @@ class _RegisterPageState extends State<RegisterPage> {
|
||||
}
|
||||
|
||||
void registerBtn() async {
|
||||
// TODO: 驗證碼未實作驗證
|
||||
if (!_isDataCorrect()) return;
|
||||
final conn = await MySQLConnection.createConnection(
|
||||
host: '10.0.2.2',
|
||||
port: 3306,
|
||||
host: '203.64.84.154',
|
||||
port: 33061,
|
||||
userName: 'root',
|
||||
password: '0000',
|
||||
databaseName: 'testdb',
|
||||
password: 'Topic@2024',
|
||||
databaseName: 'care',
|
||||
);
|
||||
await conn.connect();
|
||||
|
||||
@@ -131,7 +131,7 @@ class _RegisterPageState extends State<RegisterPage> {
|
||||
String password = _passwordController.text;
|
||||
|
||||
var result = await conn.execute(
|
||||
'SELECT * FROM users WHERE email = :email AND password = :password',
|
||||
'SELECT * FROM HomeLogin WHERE homeEmail = :email AND homePassword = :password',
|
||||
{'email': email, 'password': password},
|
||||
);
|
||||
|
||||
@@ -141,7 +141,7 @@ class _RegisterPageState extends State<RegisterPage> {
|
||||
);
|
||||
} else {
|
||||
await conn.execute(
|
||||
'INSERT INTO users (name, email, password) VALUES (:name, :email, :password)',
|
||||
'INSERT INTO HomeLogin (homeName, homeEmail, homePassword) VALUES (:name, :email, :password)',
|
||||
{'name': name, 'email': email, 'password': password},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user