Esempio n. 1
0
 public function select_simple($var, $from, $where = '', $order = '', $type_return = 'object', $limite = '')
 {
     if ($where != '') {
         $req_sql = "SELECT " . $var . " FROM " . $from . " WHERE " . $where . "";
     } else {
         $req_sql = "SELECT " . $var . " FROM " . $from . "";
     }
     if ($order != '') {
         $req_sql = $req_sql . " " . $order;
     }
     if ($limite != '') {
         $req_sql = $req_sql . ' LIMIT ' . $limite;
     }
     // $security = new security(); // instancie le fichier de securiter
     // $req_sql = $security->verif_req($req_sql); // return la requète sécurisée !
     if ($type_return == 'object') {
         $i = 0;
         while ($row = parent::fetch_object($req_sql)) {
             $res_fx[$i] = $row;
             $i++;
         }
     } else {
         if ($type_return == 'array') {
             $i = 0;
             while ($row = parent::fetch_array($req_sql)) {
                 $res_fx[$i] = $row;
                 $i++;
             }
         } else {
             if ($type_return == 'assoc') {
                 $i = 0;
                 while ($row = parent::fetch_assoc($req_sql)) {
                     $res_fx[$i] = $row;
                     $i++;
                 }
             }
         }
     }
     unset($req_sql);
     //vide le buffer de memoire $req_sql pour liberer de la place
     if (!isset($res_fx)) {
         return '';
     } else {
         return $res_fx;
     }
 }
Esempio n. 2
0
function info_table()
{
    $_db_connect = new _db_connect();
    $base_name = $_db_connect->get_name_base();
    $req_sql = "SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='" . $base_name . "'";
    while ($row = $_db_connect->fetch_object($req_sql)) {
        unset($row->TABLE_CATALOG);
        unset($row->ENGINE);
        unset($row->VERSION);
        unset($row->AVG_ROW_LENGTH);
        unset($row->INDEX_LENGTH);
        unset($row->DATA_FREE);
        unset($row->CHECK_TIME);
        unset($row->CHECKSUM);
        unset($row->CREATE_OPTIONS);
        unset($row->TABLE_COMMENT);
        affiche_pre($row);
    }
    unset($row);
    unset($req_sql);
}