Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Dionys Henzen: "Congratulations! Your MySQL PHP Generator is a great tool, that can save a lot of time and money to a developer! I'll evaluate for sure your software products when I need them. Great job".
Jonathan Oakes: "This is a lovely application. It's easy to hook into my own bespoke applications. It's very powerful, yet really quite simple to use. Thanks for this".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

createConnection

Creates a new connection to the database. Returns an instance of the EngConnection class.

 

Signature:

function createConnection()

 

Example

The code snippet below shows how to add a record to a log table when a user resets his password.

 

$connection = createConnection();

 

$sqlTemplate =

    "INSERT INTO user_log (username, action_type, action_time) " .

     "VALUES ('%s', '%s', '%s')";               

 

$sql = sprintf($sqlTemplate, $username, 'password_reset_complete', date('Y-m-d H:i:s'));

 

$connection->Connect();

$connection->ExecSQL($sql);



Prev Return to chapter overview Next