International PHP Conference Munich 2025

pg_field_is_null

(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)

pg_field_is_nullVerifica se un campo è null

Descrizione

pg_field_is_null(resource $risultato, int $tupla, mixed $campo): int

pg_field_is_null() controlla se un campo è null o meno. Restituisce se il campo nella tupla data è null. Restituisce 0 se il campo nella tupla NON è null. Il campo può essere specificato con un indice di colonna (numero) o come un nome di campo (stringa). La numerazione comincia da 0.

Nota:

Questa funzione si chiamava g_fieldisnull().

add a note

User Contributed Notes 1 note

up
0
miguel at dasilvaf dot net
22 hours ago
I'd like to emphasize another way to approach this function.

To check if the return query is null:

Let's say that the table contains a field called 'data'.

if ($ret) {
if (pg_field_is_null($ret, 'data') == 0) {
echo "Nothing returned\n";
<insert code>
}
}
To Top