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()"); ?>
Creates NULL expresion. Optional can test $value value.<?php $fieldValue = dbi::exprNull(); // NULL $fieldValue = dbi::exprNull("test"); // test $fieldValue = dbi::exprNull(0); // NULL $fieldValue = dbi::exprNull(0, true); // 0 ?>
Tests if $value is internal array structure of database expression for field value.
If $value is expression return expression as string value or else database NULL expression.<?php $result = dbi::getExpr(dbi::expr ("CURDATE()"); // "CURDATE()" $result = dbi::getExpr(12); // "NULL" ?>
Constructor of class
Common parameters to all functions:
Builds HTML hidden input element.<?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"); ?>
Builds HTML password input element.
Builds HTML select input element. Options can be grouped. Parameter $value can be string (single select or dropdown) or array type (multi select).
Builds jQuery multi select dropdown widget. In dropdown is included filtering, user can select one or more options.
For list of options see authors page.
Builds HTML text input element with $name and binds it to HTML select element. $select can be select element id or any jQuery selector. $attributes are HTML text input element attributes and/or filtering options.
data-filtergroup => false: default; apply filter on select options
data-filtergroup => true: apply filter on select group options (all options of filtered groups are displayed)<?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));
?>
Builds HTML text input element.
.
© 2003-24 iNeta d.o.o. | Koroška cesta 31, SI-4000 Kranj | info@ineta.si | Pravno obvestilo
Powered by BravoCMS