pg_fetch_row( resource $ptrQuery [, int $row ] ): array
$Tableau[$Indice]
où les indices
correspondent aux champs utilisés dans la requête
$ptrDB = pg_connect($strConnex);
if (!$ptrDB) { exit('pb de connection'); }
else {
$requete = 'select * from collectivite';
$ptrQuery = pg_query($ptrDB,$requete);
$blocHTML = "<div>\n";
if ($ptrQuery) {
$numLig = 0;
while($ligne = pg_fetch_row($ptrQuery,$numLig)) {
$blocHTML .= '<p>';
for ($j=0;$j<count($ligne);$j++) {
$blocHTML .= $ligne[$j].' ';
}
$numLig++;
$blocHTML .= "</p>\n";
}
}
$blocHTML .= '</div>';
echo $blocHTML;
}
Warning: pg_fetch_row(): Unable to jump to row 101 on PostgreSQL result
index 139711950000216 in /path/pgFetchRowSample.php on line 14
<div> <p>1 Ain 588853 5762 Rhône-Alpes </p> <p>10 Aube 303298 6004 Champagne-Ardenne </p> <p>11 Aude 353980 6139 Languedoc-Roussillon </p> <p>12 Aveyron 277048 8735 Midi-Pyrénées </p> <p>13 Bouches-du-Rhône 1967299 5087 Provence-Alpes-Côte d'Azur </p> ... </div>