salut,

j'essaye de faire marcher datagrid depuis plusieurs jours, mais rien à faire, une erreure debile doit subsister...

voici mon code :
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
25
26
27
28
29
30
31
32
33
34
35
36
37
 
<?
require_once "Structures/DataGrid.php";
 
// On met à jour la valeur du modele choisit dans la base de donnée
$sql = sprintf("UPDATE lettre SET template = ".$template." WHERE id = ".$id ) ;
$res =& $mdb2->exec($sql);
 
if (PEAR::isError($res)) {die($mdb2->getMessage());}
 
// Lecture de la BD
$datagrid =& new Structures_DataGrid(10);
$sql = "SELECT * FROM informations WHERE id_lettre =".$id;
$test = $datagrid->bind($sql, array('dsn' => $dsn));
 
// Création du tableau que l'on va afficher
 
$datagrid->addColumn(new Structures_DataGrid_Column('Num','numero'));
$datagrid->addColumn(new Structures_DataGrid_Column('img','img','img'));
$datagrid->addColumn(new Structures_DataGrid_Column('txt','txt','txt'));
 
// Affichage des erreures
if (PEAR::isError($test)) {
    echo $test->getMessage(); 
}
 
// On envoie à Smarty
$test = $datagrid->fill($smarty);
$body = $smarty->fetch('communs/tableauList.tpl');
$smarty->clear_all_assign();
$smarty->assign('body', $body);
 
// Affichage
$smarty->display('index.tpl');
echo "test";
 
?>
et voici la réponse :

Unable to determine the data source type. You may want to explicitly specify it.
Fatal error: Call to undefined method: structures_datagrid->fill() in /homez.98/mediatik/www/yann/newsletter_V2/lettre/etape1.php on line 27


qué sé passe til ?