Exemplo n.º 1
0
$params = new OdaPrepareInterface();
$params->arrayInput = array("param_name");
$INTERFACE = new ProjectInterface($params);
//--------------------------------------------------------------------------
// api/exemple.php?milis=123450&ctrl=ok&param_name=nom_site
//--------------------------------------------------------------------------
//EXEMPLE SELECT 1 ROW
$params = new OdaPrepareReqSql();
$params->sql = "SELECT *\n    FROM `api_tab_parametres` a\n    WHERE 1=1\n    AND a.`param_name` = :param_name\n;";
$params->bindsValue = ["param_name" => $INTERFACE->inputs["param_name"]];
$params->typeSQL = OdaLibBd::SQL_GET_ONE;
$retour = $INTERFACE->BD_ENGINE->reqODASQL($params);
$params = new stdClass();
$params->label = "resultat_get_one";
$params->retourSql = $retour;
$INTERFACE->addDataReqSQL($params);
//--------------------------------------------------------------------------
//EXEMPLE SELECT N ROWS
$params = new OdaPrepareReqSql();
$params->sql = "SELECT *\n    FROM `api_tab_parametres` a\n    WHERE 1=1\n;";
$params->typeSQL = OdaLibBd::SQL_GET_ALL;
$retour = $INTERFACE->BD_ENGINE->reqODASQL($params);
$params = new stdClass();
$params->label = "resultat_get_all";
$params->retourSql = $retour;
$INTERFACE->addDataReqSQL($params);
//--------------------------------------------------------------------------
//EXEMPLE CLASS
class objRetour
{
    public $id;