PHP Doku:: Checks if the field is NULL - function.oci-field-is-null.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzDatenbankerweiterungenAnbieterspezifische DatenbankerweiterungenOracle OCI8OCI8 Funktionenoci_field_is_null

Ein Service von Reinhard Neidl - Webprogrammierung.

OCI8 Funktionen

<<oci_fetch

oci_field_name>>

oci_field_is_null

(PHP 5, PECL OCI8 >= 1.1.0)

oci_field_is_nullChecks if the field is NULL

Beschreibung

bool oci_field_is_null ( resource $statement , mixed $field )

Checks if the given field from the statement is NULL.

Parameter-Liste

statement

A valid OCI statement identifier.

field

Can be a field's index or a field's name (uppercased).

Rückgabewerte

Returns TRUE if field is NULL, FALSE otherwise.

Anmerkungen

Hinweis:

In PHP versions before 5.0.0 you must use ocicolumnisnull() instead. This name still can be used, it was left as alias of oci_field_is_null() for downwards compatability. This, however, is deprecated and not recommended.


Ein BenutzerBeitrag:
- Beiträge aktualisieren...
Raju Joseph [RajuJoseph at usa dot net]
15.09.2003 4:36
<?php

// Connect to Oracle database.

//        Username  : Raju
//        Password  : Password
//        Database  : Database_name

 
$conn=OCILogon("Raju", "Password", "DATABASE_NAME");
  if ( !
$conn ) {
    echo
"Unable to connect: " . var_dump( OCIError() );
    die();
  }

// Select Data...

// DESC[RIBE] COMPANY
  
//   CompanyID          VARCHAR2(10)
//   CompanyName      VARCHAR2(30)
//   LastUserID           VARCHAR2(15)
//   LastDate              DATE
//

  
 
$query = "SELECT * FROM Company";

 
$result = OCIParse($conn, $query);
 
OCIExecute($result, OCI_DEFAULT);

while (
OCIFetchInto ($result, $row, OCI_ASSOC)) {

// Usage of OCIcolumnisnull()
if (OCIcolumnisnull($result, 'CompanyName')) {

    print (
"<P>" . $row['CompanyID'] . "--->" . "Company Name NOT found !!  " . "<P>"  );
}
else {

    print (
"<P>" . $row['CompanyID'] . "--->" . $row['CompanyName'] . "<P>"  );
}
}

// Close connection from Oracle...

 
OCILogoff($conn);
?>



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)