From 7c33bd99d93eff1aceb2d8d7e2fb391354b28fe0 Mon Sep 17 00:00:00 2001 From: JingChiang Date: Sun, 8 Sep 2024 20:19:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E8=B3=87=E6=96=99=E5=BA=AB?= =?UTF-8?q?=E9=80=A3=E6=8E=A5=EF=BC=8Ctestdb->care(RegisterPage)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/RegisterPage.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/RegisterPage.dart b/lib/RegisterPage.dart index 17fd5dd..6919bc8 100644 --- a/lib/RegisterPage.dart +++ b/lib/RegisterPage.dart @@ -115,13 +115,13 @@ class _RegisterPageState extends State { } 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 { 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 { ); } 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}, );