NOUVELLE VERSION !!! Des nouvelles classes de partout, et des supers procédures SQL.

This commit is contained in:
Mysaa
2021-06-06 13:03:33 +02:00
parent e59898b0bb
commit 3488323439
59 changed files with 2906 additions and 1403 deletions
+32
View File
@@ -0,0 +1,32 @@
<?php
class Message{
public static function postMessage($sid,$mdp,$did,$text){
$req = $GLOBALS['bdd']->prepare('CALL `PostMessage`(:sid,:mdp,:did,:text,@o);');
$req->bindValue(':sid', $sid);
$req->bindValue(':mdp', $mdp);
$req->bindValue(':did', $did);
$req->bindValue(':text', $text);
$req->execute();
$rep = $GLOBALS['bdd']->query('SELECT @o AS outputCode')->fetch();
if($rep['outputCode'] != 42)throw new SQLProcessingException($rep['outputCode']);
}
public static function deleteMessage($sid,$mdp,$mid){
$req = $GLOBALS['bdd']->prepare('CALL `DeleteMessage`(:sid,:mdp,:mid,@o);');
$req->bindValue(':sid', $sid);
$req->bindValue(':mdp', $mdp);
$req->bindValue(':mid', $mid);
$req->execute();
$rep = $GLOBALS['bdd']->query('SELECT @o AS outputCode')->fetch();
if($rep['outputCode'] != 42)throw new SQLProcessingException($rep['outputCode']);
}
}