Bonjour,

Je parts d'un:
Je veux stocker les entêtes dans un tableau (cela me permet aussi de savoir combien j'ai de colonne)
Je veux afficher les données du tableau.

Comment faire?

J'ai pour l'instant ceci.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
$user='utilisateur';
$pass='pass';
$dsn='pgsql:host=localhost;dbname=nomdb';
 
// nomdb
global $db;
$db = new PDO($dsn, $user, $pass);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
?>
 
<html>
<head>
	<meta http-equiv="refresh" content="url=index.php">
    <meta charset="utf-8">
</head>
<body>
<?php
 
$actitable = array();
$qry = $db->prepare("SELECT DISTINCT ON (col1) * FROM table WHERE LENGTH(col1) < 13 AND type = 'ACT' ");
$qry->execute();
?>