Июля 30 2010 08:05:06
Навигация
· Главная
· Статьи
· Скачать
· Форум
· Ссылки
· Категории новостей
· Обратная связь
· Галерея
· Поиск
· Гостевая
· Коллекция аватар
· CMS AP-Fusion. Отличия от PHP-Fusion
· Javascript справочник
· Разное
Сейчас на сайте
· Гостей: 8

· Пользователей: 0

· Всего пользователей: 413
· Новый пользователь: Ruslik
Информеры
Загрузка файлов  +  -
Лента alipapa.ru
Смайлики прошлого века
Шаблоны для blog-fusion
Подъем почтового сервера на VdsPlanet.
Хостинг на VdsPlanet - месяц спустя.


Хостинг на VdsPlanet.
Где взять ТИЦ?

Апдейт Google Pagerank 4 апреля
Google Supplemental Index Ratio
И опять АП
АП ТИЦ - как всегда, неожиданно.

Заработай своим умом
Комплексная автоматизация предприятий возрождается
Модели поискового поведения и взаимодействия в Web

АП ПР
Geo-IP + Google Maps - по-моему, симпатично.

Теперь Снежинск.

Зачем Яндексу нужен АГС?
Работают ли ссылки?
WHM/cPanel - продолжаем описание.
АГС-17 или зеркало в пятнах
Ссылки  +  -
Блоги
Alipapa
» Блог Алипапы
lom
» Блог Лома

sesam_fetch_row

(PHP 3 CVS only)

sesam_fetch_row -- Fetch one row as an array

Description

array sesam_fetch_row ( string result_id [, int whence [, int offset]] )

Returns an array that corresponds to the fetched row, or FALSE if there are no more rows.

The number of columns in the result set is returned in an associative array element $array["count"]. Because some of the result columns may be empty, the count() function can not be used on the result row returned by sesam_fetch_row().

result_id is a valid result id returned by sesam_query() (select type queries only!).

whence is an optional parameter for a fetch operation on "scrollable" cursors, which can be set to the following predefined constants:

Таблица 1. Valid values for "whence" parameter

ValueConstantMeaning
0SESAM_SEEK_NEXTread sequentially (after fetch, the internal default is set to SESAM_SEEK_NEXT)
1SESAM_SEEK_PRIORread sequentially backwards (after fetch, the internal default is set to SESAM_SEEK_PRIOR)
2SESAM_SEEK_FIRSTrewind to first row (after fetch, the default is set to SESAM_SEEK_NEXT)
3SESAM_SEEK_LASTseek to last row (after fetch, the default is set to SESAM_SEEK_PRIOR)
4SESAM_SEEK_ABSOLUTEseek to absolute row number given as offset (Zero-based. After fetch, the internal default is set to SESAM_SEEK_ABSOLUTE, and the internal offset value is auto-incremented)
5SESAM_SEEK_RELATIVEseek relative to current scroll position, where offset can be a positive or negative offset value.
This parameter is only valid for "scrollable" cursors.

When using "scrollable" cursors, the cursor can be freely positioned on the result set. If the whence parameter is omitted, the global default values for the scrolling type (initialized to: SESAM_SEEK_NEXT, and settable by sesam_seek_row()) are used. If whence is supplied, its value replaces the global default.

offset is an optional parameter which is only evaluated (and required) if whence is either SESAM_SEEK_RELATIVE or SESAM_SEEK_ABSOLUTE. This parameter is only valid for "scrollable" cursors.

sesam_fetch_row() fetches one row of data from the result associated with the specified result identifier. The row is returned as an array (indexed by values between 0 and $array["count"]-1). Fields may be empty, so you must check for the existence of a field by using the isset() function. The type of the returned fields depend on the respective SQL type declared for its column (see SESAM overview for the conversions applied). SESAM "multiple fields" are "inlined" and treated like a sequence of columns.

Subsequent calls to sesam_fetch_row() would return the next (or prior, or n'th next/prior, depending on the scroll attributes) row in the result set, or FALSE if there are no more rows.

Пример 1. SESAM fetch rows

<?php
$result
= sesam_query ( "SELECT * FROM phone\n" .
                       
"  WHERE LASTNAME='" . strtoupper ( $name ) . "'\n" .
                       
"  ORDER BY FIRSTNAME" , 1 );
if (!
$result ) {
    
/* ... error ... */
}
// print the table in backward order
echo "<table border=\"1\">\n" ;
$row = sesam_fetch_row ( $result , SESAM_SEEK_LAST );
while (
is_array ( $row )) {
    echo
"<tr>\n" ;
    for (
$col = 0 ; $col < $row [ "count" ]; ++ $col ) {
        echo
"<td>" . htmlspecialchars ( $row [ $col ]) . "</td>\n" ;
    }
    echo
"</tr>\n" ;
    
// use implied SESAM_SEEK_PRIOR
    
$row = sesam_fetch_row ( $result );
}
echo
"</table>\n" ;
sesam_free_result ( $result );
?>

Смотрите также: sesam_fetch_array() which returns an associative array, and sesam_fetch_result() which returns many rows per invocation.

Все функции PHP:
Авторизация
Логин

Пароль



Вы не зарегистрированы?
Нажмите здесь для регистрации.

Забыли пароль?
Запросите новый здесь.
Мини-чат
Вы должны авторизироваться, чтобы добавить сообщение.

06/07/2010 15:55
А может быть "гандидат"?

16/06/2010 13:55
правильно говорить так "кандибрат в депугады"

15/06/2010 22:18
Vveb--ws прочитал личку, спасибо. Я дальтоник немного, мне пофигу, Grin Исправлю.

27/05/2010 17:31
Недорогие туры операторов - туры в карелию. База отдыха в Карелии.
Ну вот, с престой немного продвинулись, лед тронулся.

18/05/2010 23:27
Привет.

16/05/2010 17:06
Привет Алипапа, я тут глюку нашел в каталоге, щяс на форуме напишу.

08/05/2010 22:38
Скорее жив, а вам бан большой и толстый

08/05/2010 13:08
А [*****]почему[****
*] тут так[****] мало пишут?[*****] Сайт мертв? Smile

06/05/2010 16:03
Во, еще один кандидат в депутаты вылупился

05/05/2010 16:33
С * наступающим * праздником * победы * !!!

Последние статьи
· СМС и Вебмани
· TinyMCE для пользова...
· PCRE (Perl Compatibl...
· PCRE (Perl Compatibl...
· 510
Бытовая техника:  +  
1,810,993 уникальных посетителей Iceberg by Harly