DataBase Independent package - Unified database access. Extends PHP PDO class.
DataSourceName (dsn) structure: driver://user.password@host/database
Null PHP variable value is treated as database NULL value.
Constant same as PDO::FETCH_ASSOC | PDO::FETCH_GROUP | PDO::FETCH_UNIQUE
return array resultset where key of a record row array is not numeric index but first field value
<?php $rows = $db->select ("SELECT ID, Name, Currency, ISOCode FROM Countries", null, null, null, dbi::FETCH_ASSOC_ARRAY); ?>
// $rows value: Array ( [SI] => Array ( [Name] => Slovenija [Currency] => EUR [ISOCode] => 978 ) [IT] => Array ( [Name] => Italia [Currency] => EUR [ISOCode] => 978 ) [GB] => Array ( [Name] => United Kingdom [Currency] => GBP [ISOCode] => 826 ) )
Global static boolean property to turn on or off debug info dump (shows how SQL is composed and how parameters are bind)
Splits data source name into array parts (driver, db, host, port, user, password)
Builds internal array structure of database expression for field value.
<?php $fieldValue = dbi::expr("CURDATE()"); ?>
<?php $fieldValue = dbi::exprNull(); // NULL $fieldValue = dbi::exprNull("test"); // test $fieldValue = dbi::exprNull(0); // NULL $fieldValue = dbi::exprNull(0, true); // 0 ?>
<?php $result = dbi::getExpr(dbi::expr ("CURDATE()"); // "CURDATE()" $result = dbi::getExpr(12); // "NULL" ?>
Constructor of class
Common parameters to all functions:
<?php // Outputs: <input type="hidden" name="actionID" value="save"); echo form::hidden ("actionID", "save"); // Outputs: <input type="hidden" name="actionID" id="actionID" value="save"); echo form::hidden ("#actionID", "save"); ?>
<?php // creates and binds text input with id "countryFilter" to select with id "countries" echo form::selectFilter("#countryFilter", "#countries"). form::select("#countries", $selectedCountry, $countriesOpt, array ("size" => 40)); ?>
© 2003-24 iNeta d.o.o. | Koroška cesta 31, SI-4000 Kranj | info@ineta.si | Pravno obvestilo
Powered by BravoCMS