2 Connecting - AtjonTV/MySQLm Wiki

Connecting to a Server

Constructor:

The Constructor can be used to directly connect to a Database-Sever when creating the MySQLm object.

There are a view default values:

Structure:

  1. Server Address
  2. Server Port
  3. Server User
  4. Server Password
  5. Database Name
  6. Charset

Excemple:

$msql = new MySQLm('localhost', 3306, 'localuser', 'localpass', 'database', 'utf8');

Function connect():

The Connect method can be used to change to a different Database-Server on an existing object.

There are a view default values:

Structure:

  1. Server Address
  2. Server Port
  3. Server User
  4. Server Password
  5. Database Name
  6. Charset

Excemple:

$msql = new MySQLm('','','','','','');
$msql->connect('localhost', 3306, 'localuser', 'localpass', 'database', 'utf8');

Function connect_ndb():

The Connect-NoDatabase method can be used to change to a different Database-SErver on an existing object without selecting a Database.

There are a view default values:

Structure:

  1. Server Address
  2. Server Port
  3. Server User
  4. Server Password
  5. Charset

Excemple:

$msql = new MySQLm('','','','','','');
$msql->connect_ndb('localhost', 3306, 'localuser', 'localpass', 'utf8');