PostgreSQL compatibility: suppress JOIN in DELETE
This commit is contained in:
parent
63837ebd55
commit
5f1825179a
@ -87,15 +87,10 @@ while($dsondage = $sondage->FetchNextObject(false)) {
|
||||
// On inclut la routine de suppression
|
||||
$date=date('H:i:s d/m/Y');
|
||||
|
||||
$req = 'DELETE s, su, u, c
|
||||
FROM
|
||||
sondage s LEFT JOIN sujet_studs su
|
||||
ON su.id_sondage = s.id_sondage
|
||||
LEFT JOIN user_studs u
|
||||
ON u.id_sondage = s.id_sondage
|
||||
LEFT JOIN comments c
|
||||
ON c.id_sondage = s.id_sondage
|
||||
WHERE s.id_sondage = '.$connect->Param('id_sondage');
|
||||
$req = 'DELETE FROM sujet_studs WHERE id_sondage = ' . $connect->Param('id_sondage') . '; ' .
|
||||
'DELETE FROM user_studs WHERE id_sondage = ' . $connect->Param('id_sondage') . '; ' .
|
||||
'DELETE FROM comments WHERE id_sondage = ' . $connect->Param('id_sondage') . '; ' .
|
||||
'DELETE FROM sondage WHERE id_sondage = ' . $connect->Param('id_sondage') ;
|
||||
|
||||
$sql = $connect->Prepare($req);
|
||||
$connect->Execute($sql, array($dsondage->id_sondage));
|
||||
|
@ -314,15 +314,11 @@ if (isset($_POST["confirmesuppression"]) || isset($_POST["confirmesuppression_x"
|
||||
$date=date('H:i:s d/m/Y:');
|
||||
|
||||
//destruction des données dans la base SQL
|
||||
$sql = 'DELETE s, su, u, c
|
||||
FROM
|
||||
sondage s LEFT JOIN sujet_studs su
|
||||
ON su.id_sondage = s.id_sondage
|
||||
LEFT JOIN user_studs u
|
||||
ON u.id_sondage = s.id_sondage
|
||||
LEFT JOIN comments c
|
||||
ON c.id_sondage = s.id_sondage
|
||||
WHERE s.id_sondage = '.$connect->Param('numsondage');
|
||||
$sql = 'DELETE FROM sujet_studs WHERE id_sondage = ' . $connect->Param('numsondage') . '; ' .
|
||||
'DELETE FROM user_studs WHERE id_sondage = ' . $connect->Param('numsondage') . '; ' .
|
||||
'DELETE FROM comments WHERE id_sondage = ' . $connect->Param('numsondage') . '; ' .
|
||||
'DELETE FROM sondage WHERE id_sondage = ' . $connect->Param('numsondage') ;
|
||||
|
||||
$sql = $connect->Prepare($sql);
|
||||
if ($connect->Execute($sql, array($numsondage))) {
|
||||
// on ecrit dans le fichier de logs la suppression du sondage
|
||||
|
@ -49,16 +49,10 @@ $sondage=$connect->Execute("select * from sondage");
|
||||
while ($dsondage=$sondage->FetchNextObject(false)) {
|
||||
if ($date_courante > strtotime($dsondage->date_fin)) {
|
||||
//destruction des données dans la base
|
||||
|
||||
$req = 'DELETE s, su, u, c
|
||||
FROM
|
||||
sondage s LEFT JOIN sujet_studs su
|
||||
ON su.id_sondage = s.id_sondage
|
||||
LEFT JOIN user_studs u
|
||||
ON u.id_sondage = s.id_sondage
|
||||
LEFT JOIN comments c
|
||||
ON c.id_sondage = s.id_sondage
|
||||
WHERE s.id_sondage = '.$connect->Param('id_sondage');
|
||||
$req = 'DELETE FROM sujet_studs WHERE id_sondage = ' . $connect->Param('id_sondage') . '; ' .
|
||||
'DELETE FROM user_studs WHERE id_sondage = ' . $connect->Param('id_sondage') . '; ' .
|
||||
'DELETE FROM comments WHERE id_sondage = ' . $connect->Param('id_sondage') . '; ' .
|
||||
'DELETE FROM sondage WHERE id_sondage = ' . $connect->Param('id_sondage') ;
|
||||
|
||||
$sql = $connect->Prepare($req);
|
||||
$connect->Execute($sql, array($dsondage->id_sondage));
|
||||
|
Loading…
Reference in New Issue
Block a user