afficher une valeur venant d'un fetchAll
Bonjour,
j'extraie des données de ma bdd par un fetchAll :
Code:
1 2 3
| $sql="SELECT * from `infoappli` where name='".$machselcopy."'";
$qid=$bdd->query($sql);
$datainfoapplimodif = $qid->fetchAll(PDO::FETCH_OBJ); |
Les colonnes de la table infoappli sont des noms d'application :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| CREATE TABLE IF NOT EXISTS `infoappli` (
`name` varchar(20) COLLATE latin1_bin NOT NULL DEFAULT '',
`pec` tinyint(4) DEFAULT NULL,
`autre` tinyint(4) DEFAULT NULL,
`cadence` tinyint(4) DEFAULT NULL,
`genesis` tinyint(4) DEFAULT NULL,
`licenseserver` tinyint(4) DEFAULT NULL,
`teamforge` tinyint(4) DEFAULT NULL,
`mentor` tinyint(4) DEFAULT NULL,
`em-plant` tinyint(4) DEFAULT NULL,
`moldflow` tinyint(4) DEFAULT NULL,
`pcnetlink` tinyint(4) DEFAULT NULL,
`loadpoint` tinyint(4) DEFAULT NULL,
`prointralink` tinyint(4) DEFAULT NULL,
`promecanica` tinyint(4) DEFAULT NULL,
`mdm` tinyint(4) DEFAULT NULL,
`samba` tinyint(4) DEFAULT NULL,
`ftpsccm` tinyint(4) DEFAULT NULL,
`symphony` tinyint(4) DEFAULT NULL,
`coda` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`name`),
UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin; |
Je souhaite afficher la valeur de la colonne pec pour une des machines :
Code:
1 2 3
| $sql="SELECT * from `infoappli` where name='".$machselcopy."'";
$qid=$bdd->query($sql);
$datainfoapplimodif = $qid->fetchAll(PDO::FETCH_OBJ);var_dump(($datainfoapplimodif[0])->pec); |
mais
Citation:
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in C:\wamp\www\eis2\eisnew\page\modserver.php on line 28
Pouvez-vous me corriger ?