П О Р Т А Л                            
С Е Т Е В Ы Х                          
П Р О Е К Т О В                        
  
Поиск по сайту:
                                                 
Главная

О проекте

Web-мастеру
     HTML & JavaScript
     SSI
     Perl
     PHP
     XML & XSLT
     Unix Shell

MySQL

Безопасность

Хостинг

Другое








Самое читаемое:

Учебник PHP - "Для Чайника".
Просмотров 3519 раз(а).

Иллюстрированный самоучитель по созданию сайтов.
Просмотров 6121 раз(а).

Учебник HTML.
Просмотров 3276 раз(а).

Руководство по PHP5.
Просмотров 5497 раз(а).

Хостинг через призму DNS.
Просмотров 4144 раз(а).

Подборка текстов стандартных документов.
Просмотров 55772 раз(а).

Учебник PHP - Самоучитель
Просмотров 3090 раз(а).

Документация на MySQL (учебник & справочное руководство)
Просмотров 5695 раз(а).

Внешние атаки...
Просмотров 3840 раз(а).

Учебник PHP.
Просмотров 2825 раз(а).

SSI в примерах.
Просмотров 37462 раз(а).



 
 
| Добавить в избранное | Сделать стартовой | Помощь





Руководство по PHP
Пред. След.

PDOStatement::fetchColumn

(no version information, might be only in CVS)

PDOStatement::fetchColumn --  Returns a single column from the next row of a result set

Описание

string PDOStatement::fetchColumn ( [int column_number] )

Returns a single column from the next row of a result set.

Список параметров

column_number

0-indexed number of the column you wish to retrieve from the row. If no value is supplied, PDOStatement::fetchColumn() fetches the first column.

Возвращаемые значения

PDOStatement::fetchColumn() returns a single column in the next row of a result set.

Внимание

There is no way to return another column from the same row if you use PDOStatement::fetchColumn() to retrieve data.

Примеры

Пример 1. Return first column of the next row

<?php
$sth
= $dbh->prepare("SELECT name, colour FROM fruit");
$sth->execute();

/* Fetch the first column from the next row in the result set */
print("Fetch the first column from the next row in the result set:\n");
$result = $sth->fetchColumn();
print(
"name = $result\n");

print(
"Fetch the second column from the next row in the result set:\n");
$result = $sth->fetchColumn(1);
print(
"colour = $result\n");
?>

Результат выполнения данного примера:

Fetch the first column from the next row in the result set:
name = lemon
Fetch the second column from the next row in the result set:
colour = red

Смотрите также

PDO::query()
PDOStatement::fetch()
PDOStatement::fetchAll()
PDOStatement::prepare()
PDOStatement::setFetchMode()


Пред. Начало След.
PDOStatement::fetchAll Уровень выше PDOStatement::getAttribute


Если Вы не нашли что искали, то рекомендую воспользоваться поиском по сайту:
 





Copyright © 2005-2016 Project.Net.Ru