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

О проекте

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

MySQL

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

Хостинг

Другое








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

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

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

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

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

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

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

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

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

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

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

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



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





Руководство по 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