更改資料庫連接,testdb->care(RegisterPage)

This commit is contained in:
JingChiang
2024-09-08 20:19:12 +08:00
parent edd2f57800
commit 7c33bd99d9

View File

@@ -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},
);