The "kDBConnection" class is main way of accessing database in In-Portal. There are 2 main approaches for getting data from database:
- get all data at once - you'll get array with all data back, but memory for storing that data is allocated upfront
- get one row at a time - you'll get an iterator back, that will consume memory for storing 1 row only
The iterator approach can be used in 2 ways:
|Using "kDBConnector::GetIterator" method||Using "kDBConnector::GetColIterator" method|
Useful, when each row contains several fields.
Useful, when each row contains one field.
When SELECT result 1 row * 1 column, then Debugger will show that value like so:
Unfortunately, when "kDBConnection::GetColIterator" method is used the result isn't shown and this PHP Warning is triggered:
Prior to using "current" function in "kDBConnectionDebug::GetIterator" method make sure, that current row is an array.