English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Basic PHP Tutorial

Advanced PHP Tutorial

PHP & MySQL

PHP Reference Manual

Usage and Example of PHP odbc_fetch_row() Function

PHP ODBC Reference Manual

The odbc_fetch_row() function retrieves a row

Syntax

bool odbc_fetch_row ( resource $result_id [, int $row_number ] )

Definition and Usage

It is used to get a row

Return Value

If there is a line, it returns true, otherwise it displays false

Parameter

NumberParameters and Description
1

result_id

It is used to identify the result

2

rownumber

If the line number is not specified, it will try to get a row from odbc_row_fect(),

Example

Try the following example

<?php
   $input_ID = odbc_connect("DSN", "user_id", "pass_id");
   $sql = "SELECT ProductName FROM Products";
   $result = odbc_exec($input_ID, $sql);
   
   while (odbc_fetch_row($result)) {
      echo odbc_result($result, "ProductName"), "\n";
   }
?>

PHP ODBC Reference Manual