selectData method

Future selectData(
  1. String tableName,
  2. String key,
  3. String value
)

Implementation

Future selectData(String tableName, String key, String value) async {
  // Query the database using a parameterized query
  Results? results = await mySqlConnection
      ?.query('select $tableName from users where $key = ?', [value]);
  for (var row in results!) {
    print('Name: ${row[0]}, email: ${row[1]} age: ${row[2]}');
  }
}