fix(home) displaying users favorites...

main v1.1.0
Valentin 2024-06-19 17:51:33 +02:00
parent 9801bc99d9
commit 72ea3fed6c
2 changed files with 3 additions and 4 deletions

View File

@ -8,12 +8,11 @@ function getStopName($stopId) {
return reset($result)['fields']['nom_zda'];
}
function getFavorites($lineId) {
global $conn;
try {
$query = $conn->prepare("SELECT stopId FROM favorites WHERE lineId = ?");
$query->execute([$lineId]);
$query = $conn->prepare("SELECT stopId FROM favorites WHERE lineId = ? AND userId = ?");
$query->execute([$lineId, $_SESSION['user_id']]);
$result = $query->fetchAll(PDO::FETCH_ASSOC);
return $result;

File diff suppressed because one or more lines are too long