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

О проекте

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

MySQL

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

Хостинг

Другое








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

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

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

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

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

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

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

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

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

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

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

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



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





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

PDOStatement::columnCount

(no version information, might be only in CVS)

PDOStatement::columnCount --  Returns the number of columns in the result set

Описание

int PDOStatement::columnCount ( void )

Use PDOStatement::columnCount() to return the number of columns in the result set represented by the PDOStatement object.

If the PDOStatement object was returned from PDO::query(), the column count is immediately available.

If the PDOStatement object was returned from PDO::prepare(), an accurate column count will not be available until you invoke PDOStatement::execute().

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

Returns the number of columns in the result set represented by the PDOStatement object. If there is no result set, PDOStatement::columnCount() returns 0.

Примеры

Пример 1. Counting columns

This example demonstrates how PDOStatement::columnCount() operates with and without a result set.

<?php
$dbh
= new PDO('odbc:sample', 'db2inst1', 'ibmdb2');

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

/* Count the number of columns in the (non-existent) result set */
$colcount = $sth->columnCount();
print(
"Before execute(), result set has $colcount columns (should be 0)\n");

$sth->execute();

/* Count the number of columns in the result set */
$colcount = $sth->columnCount();
print(
"After execute(), result set has $colcount columns (should be 2)\n");

?>

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

Before execute(), result set has 0 columns (should be 0)
After execute(), result set has 2 columns (should be 2)

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

PDO::prepare()
PDOStatement::execute()
PDOStatement::rowCount()


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


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





Copyright © 2005-2016 Project.Net.Ru