Beispiel #1
0
 public function verif_req($req_sql)
 {
     $db_link = parent::get_db_link();
     if (is_array($req_sql)) {
         return;
     }
     if (isset($req_sql)) {
         $req_sql = htmlentities($req_sql, ENT_QUOTES, "UTF-8");
         $req_sql = htmlspecialchars($req_sql);
         return $req_sql;
     } else {
         return 'Erreur de requète SQl , il est possible que la requète n\'existe pas';
     }
 }
Beispiel #2
0
 public function info_db_table_champ()
 {
     $req_list_champs = parent::db_get_list_champ_of_table('COLUMNS');
     foreach ($req_list_champs as $row) {
         foreach ($row as $column) {
             $column->COLUMN_TYPE = str_replace(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 0, '(', ')', 'tiny', 'medium', 'var', 'date', 'time', 'unsigned'), '', $column->COLUMN_TYPE);
             $column->COLUMN_TYPE = str_replace(array('double', 'float'), 'int', $column->COLUMN_TYPE);
             $column->COLUMN_TYPE = str_replace(array('text', 'char'), 'string', $column->COLUMN_TYPE);
             if ($column->COLUMN_TYPE == 'datetime') {
                 unset($column->COLUMN_TYPE);
             }
         }
     }
     return $req_list_champs;
 }
Beispiel #3
0
 public function delete_row($table, $where)
 {
     $req_sql = "DELETE FROM " . $table . " WHERE " . $where;
     parent::query($req_sql);
 }
Beispiel #4
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);
}