Новые книги

Человеку в современном скоростном мире, просто необходимы точка опоры и верное направление движения. Все сложное просто. Стоит лишь начать смотреть на все происходящие события, не с высоты птичьего полета, а изнутри своей системы. Вы обнаружите системные оси координат, по которым, как по компасу можно ориентироваться в сплошном поле происходящих процессов, сможете обновить умение адаптироваться к хаосу атакующих систему потоков событий, навыки включать в нужный момент интуицию, видеть то, чего не видят другие, принимать решения на шаг раньше и на шаг дальше, в понимании природы систем
Algorithms increasingly run our lives. They find books, movies, jobs, and dates for us, manage our investments, and discover new drugs. More and more, these algorithms work by learning from the trails of data we leave in our newly digital world. Like curious children, they observe us, imitate, and experiment. And in the world’s top research labs and universities, the race is on to invent the ultimate learning algorithm: one capable of discovering any knowledge from data, and doing anything we want, before we even ask.

Machine learning is the automation of discovery-the scientific method on steroids-that enables intelligent robots and computers to program themselves. No field of science today is more important yet more shrouded in mystery. Pedro Domingos, one of the field’s leading lights, lifts the veil for the first time to give us a peek inside the learning machines that power Google, Amazon, and your smartphone. He charts a course through machine learning’s five major schools of thought, showing how they turn ideas from neuroscience, evolution, psychology, physics, and statistics into algorithms ready to serve you. Step by step, he assembles a blueprint for the future universal learner-the Master Algorithm-and discusses what it means for you, and for the future of business, science, and society.

If data-ism is today’s rising philosophy, this book will be its bible. The quest for universal learning is one of the most significant, fascinating, and revolutionary intellectual developments of all time. A groundbreaking book, The Master Algorithm is the essential guide for anyone and everyone wanting to understand not just how the revolution will happen, but how to be at its forefront.

pg_fetch_array

Учебник РНР
НазадВперёд

pg_fetch_array

(PHP 3>= 3.0.1, PHP 4)

pg_fetch_array - извлекает ряд как массив.

Описание

array pg_fetch_array (resource result, int row [, int result_type])

pg_fetch_array() возвращает массив, соответствующий извлечённому ряду (пары/записи). Возвращает FALSE, если рядов больше нет.

pg_fetch_array() это расширенная версия pg_fetch_row(). В дополнение к хранению данных в числовых индексах (field index) в результирующем массиве, она также хранит данные в ассоциативных индексах (field name) по умолчанию.

row это номер запрашиваемого ряда (записи). Первый ряд 0.

result_type это необязательный параметр, управляющий тем, как инициализируется return-значение. result_type это константа, которая может принимать следующие значения: PGSQL_ASSOC, PGSQL_NUM и PGSQL_BOTH.
pg_fetch_array() возвращает ассоциативный массив, имеющий имя поля в качестве ключа с PGSQL_ASSOC, индекс поля в качестве ключа с PGSQL_NUM и оба name/index поля в качестве ключа с PGSQL_BOTH. По умолчанию PGSQL_BOTH.

Примечание: result_type был введён в PHP 4.0.

pg_fetch_array() НЕСКОЛЬКО медленнее, чем pg_fetch_row(), но значительно проще в использовании.

См. также pg_fetch_row(), pg_fetch_object() и pg_fetch_result().

Пример 1. Извлечение ряда PostgreSQL
<?php 
$conn = pg_pconnect ("dbname=publisher");
if (!$conn) {
    echo "An error occured.\n";
    exit;
}

$result = pg_query ($conn, "SELECT * FROM authors");
if (!$result) {
    echo "An error occured.\n";
    exit;
}

$arr = pg_fetch_array ($result, 0, PGSQL_NUM);
echo $arr[0] . " <- array\n";

$arr = pg_fetch_array ($result, 1, PGSQL_ASSOC);
echo $arr["author"] . " <- array\n";
?>

Примечание: начиная с 4.1.0, row стал необязательным. Вызов pg_fetch_array() увеличивает внутренний счётчик рядов на 1.


Назад Оглавление Вперёд
pg_escape_string Вверхpg_fetch_object