PHP-Fusion
v.7.01
AP-Fusion
v7.02.05
Pimped-Fusion-AP
v0.09.03
March 28 2024 13:56:35
Авторизация
Логин

Пароль



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

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

lom
06/04/2018 14:03
Мы рады, ждем девятку. Очень хочется пощупать

Alipapa
27/03/2018 22:16
Всем привет, все неисправности устранили, всё у нас работает

mukaton
30/10/2015 02:37
Не получается ничего скачать. Ошибка Not Found

Alipapa
06/10/2015 23:00
9-я версия php-fusion на подходе, следите за новостями

Alipapa
10/11/2014 11:24
Заметь, я дважды ответил через 3 минуты после вопроса, могли бы уже решить

Последние статьи
· О стабилизаторах нап...
· СМС и Вебмани
· TinyMCE для пользова...
· PCRE (Perl Compatibl...
· PCRE (Perl Compatibl...
Последние активные темы форума
  Темы Просмотров Ответов Последние сообщения
PHP-Fusion 7 Bogatyr - бесп...
Моды, плагины
7103 1 Vveb--ws
08-10-2018 16:47
Php-Fusion v9. Первые впеча...
Вопросы по работе
4471 3 Vveb--ws
25-07-2018 13:46
Появился хэлп по PHP-Fusion...
Вопросы по работе
6710 7 Vveb--ws
25-07-2018 13:42
prestashop&ap-fusion
Вопросы по работе
17302 61 Alipapa
26-08-2014 10:29
Плагин магазина Ap-Shop
Моды, плагины
14529 70 Alipapa
18-08-2014 18:14
TinyMCE
Вопросы по работе
21052 55 Alipapa
27-07-2013 21:57
HTML-5
Моды, плагины
5415 1 Alipapa
15-06-2013 19:47
Мультиязычность в Pimped-Fu...
Ошибки, баги, глюки
6243 4 Papich
16-04-2013 12:39
Pimped-Fusion. Первые впеча...
Ошибки, баги, глюки
21612 127 Alipapa
18-12-2012 10:59
Ищу мод для расстановки код...
Моды, плагины
14964 55 Alipapa
17-09-2012 14:00
Как присоединить файл к лич...
Моды, плагины
8246 3 lom
27-05-2012 18:12
Что мне не нравится в после...
Вопросы по работе
6835 4 Alipapa
27-05-2012 18:08
Проблемы с добавлением кате...
Вопросы по работе
7715 5 Alipapa
27-05-2012 18:06

sesam_fetch_array

(PHP 3 CVS only)

sesam_fetch_array -- Fetch one row as an associative array

Description

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

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

sesam_fetch_array() is an alternative version of sesam_fetch_row(). Instead of storing the data in the numeric indices of the result array, it stores the data in associative indices, using the field names as keys.

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

For the valid values of the optional whenceand offset parameters, see the sesam_fetch_row() function for details.

sesam_fetch_array() fetches one row of data from the result associated with the specified result identifier. The row is returned as an associative array. Each result column is stored with an associative index equal to its column (aka. field) name. The column names are converted to lower case.

Columns without a field name (e.g., results of arithmetic operations) and empty fields are not stored in the array. Also, if two or more columns of the result have the same column names, the later column will take precedence. In this situation, either call sesam_fetch_row() or make an alias for the column.

SELECT TBL1.COL AS FOO, TBL2.COL AS BAR FROM TBL1, TBL2

A special handling allows fetching "multiple field" columns (which would otherwise all have the same column names). For each column of a "multiple field", the index name is constructed by appending the string "(n)" where n is the sub-index of the multiple field column, ranging from 1 to its declared repetition factor. The indices are NOT zero based, in order to match the nomenclature used in the respective query syntax. For a column declared as:

CREATE TABLE ... ( ... MULTI(3) INT )

the associative indices used for the individual "multiple field" columns would be "multi(1)", "multi(2)", and "multi(3)" respectively.

Subsequent calls to sesam_fetch_array() 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 array

<?php
$result
= sesam_query ( "SELECT * FROM phone\n" .
                       
"  WHERE LASTNAME='" . strtoupper ( $name ) . "'\n" .
                       
"  ORDER BY FIRSTNAME" , 1 );
if (!
$result ) {
    
/* ... error ... */
}
// print the table:
echo "<table border=\"1\">\n" ;
while ((
$row = sesam_fetch_array ( $result )) && count ( $row ) > 0 ) {
    echo
"<tr>\n" ;
    echo
"<td>" . htmlspecialchars ( $row [ "firstname" ]) . "</td>\n" ;
    echo
"<td>" . htmlspecialchars ( $row [ "lastname" ]) . "</td>\n" ;
    echo
"<td>" . htmlspecialchars ( $row [ "phoneno" ]) . "</td>\n" ;
    echo
"</tr>\n" ;
}
echo
"</table>\n" ;
sesam_free_result ( $result );
?>

Смотрите также: sesam_fetch_row() which returns an indexed array.

Все функции PHP:
Навигация
· Новости
· Статьи
· Скачать
· Форум
· Ссылки
· Категории новостей
· Обратная связь
· Галерея
· Поиск
· CMS AP-Fusion. Отличия от PHP-Fusion
· Javascript справочник
· Техника
Сейчас на сайте
· Гостей: 2

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

· Всего пользователей: 453
· Новый пользователь: ZDA
Информеры
Загрузка файлов  +  -
9,910,184 уникальных посетителей Iceberg by Harly