Instancing
Previous  Next

Here below the standard way to instance a Gladius database engine.

<?php
            // creates the Gladius instance
            $G = new Gladius();
?>

You can also use the following syntax:

<?php
            // creates the Gladius instance
            $G = new Gladius('database_name/');

            // checks for a successful operation
            if ($G->errno != _G__SUCCESS)
                        die($G->errstr);
?>

which is equivalent to

<?php
            // creates the Gladius instance
            $G = new Gladius();

            $G->SelectDB('database_name/') or die($G->errstr);
?>

Note the different way error checking is performed. It is suggested the former way to better handle errors.