5 Insert - AtjonTV/MySQLm Wiki

Insert

Function executeInsert():

The executeInsert method can be used to insert into Tables.

The function requieres the full SQL-Query without the INSERT keyword.

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. SQL-Query

Example:

// Example with escapecharacters denyed
$msql->executeInsert('INTO Users (name, email) VALUES ("AtjonTV", "[email protected]"');
$msql->executeInsert('INTO Users (name, email) VALUES ("AtjonTV", "[email protected]"', false);

// Example with escapecharacters allowed
$msql->executeInsert('INTO Users (name, email) VALUES ("AtjonTV", "[email protected]"', true);

SQL-Query:

INSERT INTO Users (name, email) VALUES ("AtjonTV", "[email protected]";