GOModel sqlite database connection

Connect to sqlite database

Connect to sqlite database using connect function. You need to set file path for sqlite in database name and set dbType = "sqlite"

Function Defination

                                void function connect($hostName, $userName, $password, $databaseName, $dbType = "mysql", $charset = "utf8");

Parameters Details

Details Type Example
$userName - username of database to connect with string e.g. ""
$password - password string e.g. ""
$databaseName - database name string e.g. ""
$dbType - type of db string e.g. "sqlite"(default), pgsql, mysql
$charset - character set string e.g. "utf8"


                                $GOModel = new GOModel(); //create object of the GOModel class
                                $GOModel->connect("", "", "", "path-of-sqlite-file","sqlite");//connect to database

More Examples

                                // another way
                                $GOModel->dbSQLitePath = "path-of-sqlite-file";
                                $GOModel->connect("", "", "", "" ,"sqlite","");//connect to database                                


SQLite Database will be connected


Option Details Example
print_r($GOModel->error) Print errors (if any)