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
|
// On inclut la routine de suppression
|
||||||
$date=date('H:i:s d/m/Y');
|
$date=date('H:i:s d/m/Y');
|
||||||
|
|
||||||
$req = 'DELETE s, su, u, c
|
$req = 'DELETE FROM sujet_studs WHERE id_sondage = ' . $connect->Param('id_sondage') . '; ' .
|
||||||
FROM
|
'DELETE FROM user_studs WHERE id_sondage = ' . $connect->Param('id_sondage') . '; ' .
|
||||||
sondage s LEFT JOIN sujet_studs su
|
'DELETE FROM comments WHERE id_sondage = ' . $connect->Param('id_sondage') . '; ' .
|
||||||
ON su.id_sondage = s.id_sondage
|
'DELETE FROM sondage WHERE id_sondage = ' . $connect->Param('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');
|
|
||||||
|
|
||||||
$sql = $connect->Prepare($req);
|
$sql = $connect->Prepare($req);
|
||||||
$connect->Execute($sql, array($dsondage->id_sondage));
|
$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:');
|
$date=date('H:i:s d/m/Y:');
|
||||||
|
|
||||||
//destruction des données dans la base SQL
|
//destruction des données dans la base SQL
|
||||||
$sql = 'DELETE s, su, u, c
|
$sql = 'DELETE FROM sujet_studs WHERE id_sondage = ' . $connect->Param('numsondage') . '; ' .
|
||||||
FROM
|
'DELETE FROM user_studs WHERE id_sondage = ' . $connect->Param('numsondage') . '; ' .
|
||||||
sondage s LEFT JOIN sujet_studs su
|
'DELETE FROM comments WHERE id_sondage = ' . $connect->Param('numsondage') . '; ' .
|
||||||
ON su.id_sondage = s.id_sondage
|
'DELETE FROM sondage WHERE id_sondage = ' . $connect->Param('numsondage') ;
|
||||||
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 = $connect->Prepare($sql);
|
$sql = $connect->Prepare($sql);
|
||||||
if ($connect->Execute($sql, array($numsondage))) {
|
if ($connect->Execute($sql, array($numsondage))) {
|
||||||
// on ecrit dans le fichier de logs la suppression du sondage
|
// 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)) {
|
while ($dsondage=$sondage->FetchNextObject(false)) {
|
||||||
if ($date_courante > strtotime($dsondage->date_fin)) {
|
if ($date_courante > strtotime($dsondage->date_fin)) {
|
||||||
//destruction des données dans la base
|
//destruction des données dans la base
|
||||||
|
$req = 'DELETE FROM sujet_studs WHERE id_sondage = ' . $connect->Param('id_sondage') . '; ' .
|
||||||
$req = 'DELETE s, su, u, c
|
'DELETE FROM user_studs WHERE id_sondage = ' . $connect->Param('id_sondage') . '; ' .
|
||||||
FROM
|
'DELETE FROM comments WHERE id_sondage = ' . $connect->Param('id_sondage') . '; ' .
|
||||||
sondage s LEFT JOIN sujet_studs su
|
'DELETE FROM sondage WHERE id_sondage = ' . $connect->Param('id_sondage') ;
|
||||||
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');
|
|
||||||
|
|
||||||
$sql = $connect->Prepare($req);
|
$sql = $connect->Prepare($req);
|
||||||
$connect->Execute($sql, array($dsondage->id_sondage));
|
$connect->Execute($sql, array($dsondage->id_sondage));
|
||||||
|
Loading…
Reference in New Issue
Block a user