1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| //EXECUTION DE LA REQUETE PASSEE EN PARAMETRE (SELECT)
function execute($query)
{
error_reporting(0);
if (($this->verif != "nok") && ($this->verif != "ok"))
{
$this->verif = "nok";
}
else
{
$stid=oci_parse( $this->connection, $query);
oci_execute($stid, OCI_COMMIT_ON_SUCCESS);
$row=array();
$tab=array();
$nrows = oci_fetch_all($stid, $results);
$this->nbresults=$nrows;
if ($nrows > 0)
{
for ($i = 0; $i < $nrows; $i++)
{
$tab=array();
$compteur=1;
foreach ($results as $data)
{
$tab[oci_field_name($stid, $compteur)] = $data[$i];
$compteur++;
}
array_push($this->results, $tab);
}
$this->verif1 = "ok";
}
else
{
$this->verif1 = "nok";
}
}
error_reporting(1);
return $this->verif1;
} |
Partager