diff --git a/manager/repo/state.php b/manager/repo/state.php index 2dca7c5..f9891c0 100644 --- a/manager/repo/state.php +++ b/manager/repo/state.php @@ -20,8 +20,8 @@ */ public static function getForChip($id_chip){ - $req = Database::getPDO()->prepare("SELECT s.state, pm.id_chip, GROUP_CONCAT(s.value) as pin_values - FROM state as s, (SELECT * FROM pin_merge ORDER BY pin ASC) as pm + $req = Database::getPDO()->prepare("SELECT s.state, pm.id_chip, GROUP_CONCAT(s.value ORDER BY pm.pin ASC) as pin_values + FROM state as s, pin_merge as pm WHERE s.id_pin_merge = pm.id_pin_merge AND pm.id_chip = :id_chip GROUP BY s.state, pm.id_chip");