This repository was archived by the owner on Dec 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
4 Create
AtjonTV edited this page Nov 20, 2018
·
2 revisions
Function executeCreate():
The executeCreate method can be used to create Databases and Tables.
The function requieres the full SQL-Query without the CREATE
keyword.
This method is SQL-Injection save by default. To disable SQL-Injection-Prevention in order to use escapecharacters like
'
, you need to supply atrue
boolean value.
Structure:
- SQL-Query
Database Example:
// Example with escapecharacters denyed
$msql->executeCreate('DATABASE MyApp');
$msql->executeCreate('DATABASE MyApp', false);
// Example with escapecharacters allowed
$msql->executeCreate('DATABASE MyApp', true);
SQL-Query:
CREATE DATABASE MyApp;
Table Example:
// Example with escapecharacters denyed
$msql->executeCreate('TABLE Users (id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, name VARCHAR(30) NOT NULL, email VARCHAR(50))');
$msql->executeCreate('TABLE Users (id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, name VARCHAR(30) NOT NULL, email VARCHAR(50))', false);
// Example with escapecharacters allowed
$msql->executeCreate('TABLE Users (id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, name VARCHAR(30) NOT NULL, email VARCHAR(50))', true);
SQL-Query:
CREATE TABLE Users (id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, name VARCHAR(30) NOT NULL, email VARCHAR(50));
Copyright 2015-2018 ATVG-Studios | This is a Software Licensed under the Open Source Project License by ATVG-Studios