mysql-native Help required

Vino akashvino79 at gmail.com
Thu Oct 22 11:04:53 UTC 2020


Hi All,


   Request your help on the below code as it is not working as 
expected.

GetConnections.d

module common.GetConnections;
import mysql;

class Connections
{
   private Connection conn;
   auto constr = 
"host=localhost;port=3910;user=user;pwd=password#;db=testdb";
   this.conn = new Connection(constr);
}

GetHost.d

import common.GetConnections;
import std.array : array;
import std.variant;
import mysql;
import std.stdio: writeln;

void main()
{
  auto conn = new Connections();
  Row[] data = conn.query("SELECT * FROM hostlog").array;
  writeln(data[]);
}

From,
Vino


More information about the Digitalmars-d-learn mailing list