3 Chaning Database - AtjonTV/MySQLm Wiki

Changing the Database

Function executeUse():

The executeUse method can be used to change the currently selected database.

The method makes a SQL-Query to the database with the USE command.

This method is SQL-Injection save by default. To disable SQL-Injection-Prevention in order to use escapecharacters like ', you need to supply a true boolean value.

Structure:

  1. Database
  2. Allow UnsafeQueryExecution

Example:

// Example with escapecharacters denyed
$msql->executeUse('database');
$msql->executeUse('database', false);

// Example with escapecharacters allowed
$msql->executeUse('database', true);

SQL-Query:

USE 'database';