Browse Source

bugfix

categories supprimées lors d'un updateEvent
master
n0m1s 10 years ago
parent
commit
b9fc2772ee
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      databaseOperations.php

+ 1
- 2
databaseOperations.php View File

@ -332,11 +332,10 @@ function updateEvent($db, $id, $titre, $catArray, $localisation, $dtstart, $dten
$request = $db->prepare('DELETE FROM eventCategorie WHERE event_id=:id'); $request = $db->prepare('DELETE FROM eventCategorie WHERE event_id=:id');
$request->execute(array('id'=>$id)); $request->execute(array('id'=>$id));
$request->closeCursor(); $request->closeCursor();
$newEventId = $db->lastInsertId();
$request = $db->prepare('INSERT INTO eventCategorie(event_id, cat_id) VALUES(:eventId, :catId)'); $request = $db->prepare('INSERT INTO eventCategorie(event_id, cat_id) VALUES(:eventId, :catId)');
foreach($catArray as $cat) foreach($catArray as $cat)
{ {
$request->execute(array('eventId'=>$newEventId,
$request->execute(array('eventId'=>$id,
'catId'=>$cat)); 'catId'=>$cat));
} }
$db->commit(); $db->commit();


Loading…
Cancel
Save