[repo.ue] Fixed request stacker + fixed UE request

This commit is contained in:
Unknown 2018-04-01 13:10:36 +02:00
parent f65513a241
commit 32da5131b4
2 changed files with 8 additions and 11 deletions

View File

@ -154,23 +154,19 @@ class PDOWrapper extends \PDO
//find the given pattern in the request, then call our function and replace the matched string by the return value of our function //find the given pattern in the request, then call our function and replace the matched string by the return value of our function
$finalStatement .= rtrim(preg_replace_callback("/(:[a-z_\-0-9]*)/is",function($matches) use (&$i,&$tempParametes){ $finalStatement .= rtrim(preg_replace_callback("/(:[a-z_\-0-9]*)/is",function($matches) use (&$i,&$tempParametes){
//get next number
$i++;
//delete the ':' at the beginning of the string
$tempKey = ltrim($matches[0],':');
//copy the parameter with the modified index //copy the parameter with the modified index
$tempParametes[$tempKey.$i] = $tempParametes[$tempKey]; $tempParametes[":$i"] = $tempParametes[$matches[0]];
//delete the old index //delete the old index
unset($tempParametes[$tempKey]); unset($tempParametes[$matches[0]]);
//return the modified string for replacement //return the modified string for replacement
return $matches[0].$i; return ":".$i++;
},$statement),';').';'; },$statement),';').';';
$finalExecute = array_merge($finalExecute,$tempParametes); $finalExecute += $tempParametes;
} }
//disable stacking //disable stacking
@ -184,6 +180,7 @@ class PDOWrapper extends \PDO
$req = $this->prepare($finalStatement); $req = $this->prepare($finalStatement);
$success = $req->execute($finalExecute); $success = $req->execute($finalExecute);
//as we execute multiple query that we don't fetch, we have to close the cursor if we want to do other requests later //as we execute multiple query that we don't fetch, we have to close the cursor if we want to do other requests later
$req->closeCursor(); $req->closeCursor();
$this->commit(); $this->commit();

View File

@ -195,9 +195,9 @@ class ue extends Repo_i {
IFNULL(formlist.nbrCours,0) nbrCours, IFNULL(formlist.nbrCours,0) nbrCours,
IFNULL(formlist.nbrTD,0) nbrTD, IFNULL(formlist.nbrTD,0) nbrTD,
IFNULL(formlist.nbrTP,0) nbrTP, IFNULL(formlist.nbrTP,0) nbrTP,
IFNULL(formlist.modCours,1) modCours, IFNULL(formlist.modCours,0) modCours,
IFNULL(formlist.modTD,1) modTD, IFNULL(formlist.modTD,0) modTD,
IFNULL(formlist.modTP,1) modTP, IFNULL(formlist.modTP,0) modTP,
IFNULL(formlist.nbrProfCours,0) nbrProfCours, IFNULL(formlist.nbrProfCours,0) nbrProfCours,
IFNULL(formlist.nbrProfTD,0) nbrProfTD, IFNULL(formlist.nbrProfTD,0) nbrProfTD,
IFNULL(formlist.nbrProfTP,0) nbrProfTP IFNULL(formlist.nbrProfTP,0) nbrProfTP