PHP : Function Reference : Oracle Functions : ocicolumnisnull
raju joseph rajujoseph
<?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 ( "
" . $row['CompanyID'] . "--->" . "Company Name NOT found !! " . "
" );
}
else {
print ("
" . $row['CompanyID'] . "--->" . $row['CompanyName'] . "
" );
}
}
// Close connection from Oracle...
OCILogoff($conn);
?>
|